Skip to contentSkip to navigationSkip to topbar
On this page

Service Resource


A Service provides control and configuration for how Transcripts are processed. Any Transcript created belongs to a particular Service and inherits its configuration.

The Service-level configuration includes features like data logging, auto-transcribe, and auto-redaction. Language Operator deployments to a Service are handled through the Twilio Console.


Service configuration

service-configuration page anchor

Automatically analyze all Twilio call recordings in your account

automatically-analyze-all-twilio-call-recordings-in-your-account page anchor

Enable auto_transcribe if you want to automatically transcribe all Twilio call recordings that are recorded in an account. Auto-transcribe can help you transcribe call recordings without the need of calling the create Transcript Resource. You can enable auto-transcribe through the Service Resource or on the Console, under Service settings.

If you enable auto_transcribe in more than one Service, the call recording will be sent and transcribed more than once, and charged accordingly.

With Voice Intelligence, you can redact Personal Identifiable Information (PII) from your call recording and transcript. PII redaction utilizes artificial intelligence and machine learning technologies.

Update your Service with auto_redaction = true to automatically redact PII from all transcripts made on this Service. If you also want to automatically redact PII from all transcripts media sent to the Service, set media_redaction = true.

(warning)

Warning

If you change the PII redaction or auto-transcribe setting on a Service, it can take up to 10 minutes to come into effect.

The LanguageCode set during Service creation determines the Transcription language for all call recordings processed by that Service. Refer to Supported Languages for a list of available language codes. The default is en-US if no LanguageCode is set.

(information)

Info

A Service can only support one LanguageCode, and it cannot be updated once it's set. To transcribe call recordings in multiple languages, create a separate Service for each language.


Property nameTypeRequiredDescriptionChild properties
account_sidSID<AC>Optional
Not PII

The unique SID identifier of the Account the Service belongs to.

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

auto_redactionbooleanOptional

Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service.


media_redactionbooleanOptional

Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise.


auto_transcribebooleanOptional

Instructs the Speech Recognition service to automatically transcribe all recordings made on the account.


data_loggingbooleanOptional

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.


date_createdstring<date-time>Optional

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


date_updatedstring<date-time>Optional

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


friendly_namestringOptional

A human readable description of this resource, up to 64 characters.


language_codestringOptional

The language code set during Service creation determines the Transcription language for all call recordings processed by that Service. The default is en-US if no language code is set. A Service can only support one language code, and it cannot be updated once it's set.


sidstringOptional

A 34 character string that uniquely identifies this Service.


unique_namestringOptional

Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID.


urlstring<uri>Optional

The URL of this resource.


webhook_urlstringOptional

The URL Twilio will request when executing the Webhook.


webhook_http_methodenum<string>Optional

The HTTP method for the Webhook. One of GET or POST.

Possible values:
GETPOSTNULL

read_only_attached_operator_sidsarray[SID<LY>]Optional

Operator sids attached to this service, read only


versionintegerOptional

The version number of this Service.

Default: 0

The webhook_url attribute allows you to specify a URL for Twilio to send webhook requests to on each event specified in the event_type attribute.

Twilio will pass the following parameters with its request to your webhook URL:

ParameterDescription
account_sidThe unique identifier of the Account responsible for this Transcript.
service_sidA unique identifier for the Service associated with the Transcript.
transcript_sidThe unique identifier for the Transcript.
customer_keyCustomer key provided by the user on the Transcript creation.
event_typeThe type of the webhook event. The value will be voice_intelligence_transcript_available.

POST https://intelligence.twilio.com/v2/Services

Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
UniqueNamestringrequired

Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID.


AutoTranscribebooleanOptional

Instructs the Speech Recognition service to automatically transcribe all recordings made on the account.


DataLoggingbooleanOptional

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.


FriendlyNamestringOptional

A human readable description of this resource, up to 64 characters.


LanguageCodestringOptional

The language code set during Service creation determines the Transcription language for all call recordings processed by that Service. The default is en-US if no language code is set. A Service can only support one language code, and it cannot be updated once it's set.


AutoRedactionbooleanOptional

Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service.


MediaRedactionbooleanOptional

Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise.


WebhookUrlstringOptional

The URL Twilio will request when executing the Webhook.


WebhookHttpMethodenum<string>Optional

The HTTP method for the Webhook. One of GET or POST.

Possible values:
GETPOSTNULL
Create a ServiceLink to code sample: Create a Service
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 createService() {
11
const service = await client.intelligence.v2.services.create({
12
uniqueName: "UniqueName",
13
});
14
15
console.log(service.accountSid);
16
}
17
18
createService();

Output

1
{
2
"sid": "GAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"unique_name": "UniqueName",
4
"friendly_name": "some friendly name",
5
"date_created": "2010-08-31T20:36:28Z",
6
"date_updated": "2010-08-31T20:36:28Z",
7
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
8
"auto_redaction": false,
9
"media_redaction": false,
10
"auto_transcribe": true,
11
"data_logging": true,
12
"language_code": "en-US",
13
"webhook_url": "https://www.twilio.com",
14
"webhook_http_method": "POST",
15
"read_only_attached_operator_sids": [
16
"LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
17
],
18
"version": 1,
19
"url": "https://intelligence.twilio.com/v2/Services/GAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
20
}

GET https://intelligence.twilio.com/v2/Services/{Sid}

Property nameTypeRequiredPIIDescription
Sidstringrequired

A 34 character string that uniquely identifies this Service.

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 fetchService() {
11
const service = await client.intelligence.v2.services("Sid").fetch();
12
13
console.log(service.accountSid);
14
}
15
16
fetchService();

Output

1
{
2
"sid": "Sid",
3
"unique_name": "something",
4
"friendly_name": "some friendly name",
5
"date_created": "2010-08-31T20:36:28Z",
6
"date_updated": "2010-08-31T20:36:28Z",
7
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
8
"auto_redaction": false,
9
"media_redaction": false,
10
"auto_transcribe": true,
11
"data_logging": true,
12
"language_code": "en-US",
13
"webhook_url": "https://www.twilio.com",
14
"webhook_http_method": "POST",
15
"read_only_attached_operator_sids": [
16
"LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
17
],
18
"version": 1,
19
"url": "https://intelligence.twilio.com/v2/Services/GAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
20
}

GET https://intelligence.twilio.com/v2/Services

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.

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 listService() {
11
const services = await client.intelligence.v2.services.list({ limit: 20 });
12
13
services.forEach((s) => console.log(s.accountSid));
14
}
15
16
listService();

Output

1
{
2
"services": [
3
{
4
"sid": "GAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"unique_name": "something",
6
"friendly_name": "some friendly name",
7
"date_created": "2010-08-31T20:36:28Z",
8
"date_updated": "2010-08-31T20:36:28Z",
9
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
10
"auto_redaction": false,
11
"media_redaction": false,
12
"auto_transcribe": true,
13
"data_logging": true,
14
"language_code": "en-US",
15
"webhook_url": "https://www.twilio.com",
16
"webhook_http_method": "POST",
17
"read_only_attached_operator_sids": [
18
"LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
19
],
20
"version": 1,
21
"url": "https://intelligence.twilio.com/v2/Services/GAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
22
}
23
],
24
"meta": {
25
"key": "services",
26
"page": 0,
27
"page_size": 50,
28
"first_page_url": "https://intelligence.twilio.com/v2/Services?PageSize=50&Page=0",
29
"next_page_url": null,
30
"previous_page_url": null,
31
"url": "https://intelligence.twilio.com/v2/Services?PageSize=50&Page=0"
32
}
33
}

POST https://intelligence.twilio.com/v2/Services/{Sid}

(information)

Info

It can take up to 5 minutes to propagate any changes to a Service.

Transcripts generated just after updating parameters like AutoTranscribe, AutoRedaction or MediaRedaction may be generated with the old configuration. After 5 minutes, the newly-created Transcripts will have the new configuration.

Property nameTypeRequiredPIIDescription
If-MatchstringOptional

The If-Match HTTP request header

Property nameTypeRequiredPIIDescription
Sidstringrequired

A 34 character string that uniquely identifies this Service.

Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
AutoTranscribebooleanOptional

Instructs the Speech Recognition service to automatically transcribe all recordings made on the account.


DataLoggingbooleanOptional

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.


FriendlyNamestringOptional

A human readable description of this resource, up to 64 characters.


UniqueNamestringOptional

Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID.


AutoRedactionbooleanOptional

Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service.


MediaRedactionbooleanOptional

Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise.


WebhookUrlstringOptional

The URL Twilio will request when executing the Webhook.


WebhookHttpMethodenum<string>Optional

The HTTP method for the Webhook. One of GET or POST.

Possible values:
GETPOSTNULL
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 updateService() {
11
const service = await client.intelligence.v2
12
.services("Sid")
13
.update({ autoTranscribe: false });
14
15
console.log(service.accountSid);
16
}
17
18
updateService();

Output

1
{
2
"sid": "Sid",
3
"unique_name": "something",
4
"friendly_name": "some friendly name",
5
"date_created": "2010-08-31T20:36:28Z",
6
"date_updated": "2010-08-31T20:36:28Z",
7
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
8
"auto_redaction": false,
9
"media_redaction": false,
10
"auto_transcribe": false,
11
"data_logging": true,
12
"webhook_url": "https://www.sendgrid.com",
13
"webhook_http_method": "GET",
14
"language_code": "en-US",
15
"read_only_attached_operator_sids": [
16
"LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
17
],
18
"version": 2,
19
"url": "https://intelligence.twilio.com/v2/Services/GAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
20
}

DELETE https://intelligence.twilio.com/v2/Services/{Sid}

Property nameTypeRequiredPIIDescription
Sidstringrequired

A 34 character string that uniquely identifies this Service.

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 deleteService() {
11
await client.intelligence.v2.services("Sid").remove();
12
}
13
14
deleteService();