Skip to contentSkip to navigationSkip to topbar
On this page

CustomOperator Subresource


The CustomOperator subresource of the Operator resource represents a Custom Operator.


Custom Properties

custom-properties page anchor
Property nameTypeRequiredDescriptionChild properties
account_sidSID<AC>Optional
Not PII

The unique SID identifier of the Account the Custom Operator belongs to.

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

sidSID<LY>Optional

A 34 character string that uniquely identifies this Custom Operator.

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

friendly_namestringOptional

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


descriptionstringOptional

A human-readable description of this resource, longer than the friendly name.


authorstringOptional

The creator of the Custom Operator. Custom Operators can only be created by a Twilio Account.


operator_typestringOptional

Operator Type for this Operator. References an existing Operator Type resource.


versionintegerOptional

Numeric Custom Operator version. Incremented with each update on the resource, used to ensure integrity when updating the Custom Operator.

Default: 0

availabilityenum<string>Optional

Custom Operator availability status. Possible values: internal, beta, public, retired.

Possible values:
internalbetapublicretired

configobjectOptional

Operator configuration, following the schema defined by the Operator Type. Only available on Operators created by the Account.


date_createdstring<date-time>Optional

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


date_updatedstring<date-time>Optional

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


urlstring<uri>Optional

The URL of this resource.


Create a Custom Operator

create-a-custom-operator page anchor
POST https://intelligence.twilio.com/v2/Operators/Custom

This endpoint creates a new Custom Operator for an Account.

Request body parameters

request-body-parameters page anchor
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
FriendlyNamestringrequired

A human readable description of the new Operator, up to 64 characters.


OperatorTypestringrequired

Operator Type for this Operator. References an existing Operator Type resource.


Configobjectrequired

Operator configuration, following the schema defined by the Operator Type.

Create a CustomLink to code sample: Create a Custom
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 createCustomOperator() {
11
const customOperator = await client.intelligence.v2.customOperators.create({
12
config: {},
13
friendlyName: "FriendlyName",
14
operatorType: "OperatorType",
15
});
16
17
console.log(customOperator.accountSid);
18
}
19
20
createCustomOperator();

Output

1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"sid": "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"friendly_name": "FriendlyName",
5
"description": "New Operator",
6
"author": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
7
"operator_type": "OperatorType",
8
"version": 1,
9
"availability": "public",
10
"config": {
11
"configuration": {
12
"field": "value"
13
}
14
},
15
"date_created": "2010-08-31T20:36:28Z",
16
"date_updated": "2010-08-31T20:36:28Z",
17
"url": "https://intelligence.twilio.com/v2/Operators/Custom/LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
18
}

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

This endpoint retrieves the details of a Custom Operator using its SID.

Property nameTypeRequiredPIIDescription
SidSID<LY>required

A 34 character string that uniquely identifies this Custom Operator.

Pattern: ^LY[0-9a-fA-F]{32}$Min length: 34Max length: 34
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 fetchCustomOperator() {
11
const customOperator = await client.intelligence.v2
12
.customOperators("LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.fetch();
14
15
console.log(customOperator.accountSid);
16
}
17
18
fetchCustomOperator();

Output

1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"sid": "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"friendly_name": "My New Operator",
5
"description": "New Operator",
6
"author": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
7
"operator_type": "operator-type-name",
8
"version": 1,
9
"availability": "public",
10
"config": {
11
"configuration": {
12
"field": "value"
13
}
14
},
15
"date_created": "2010-08-31T20:36:28Z",
16
"date_updated": "2010-08-31T20:36:28Z",
17
"url": "https://intelligence.twilio.com/v2/Operators/Custom/LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
18
}

GET https://intelligence.twilio.com/v2/Operators/Custom

This endpoint lists all available Custom Operators for an Account, with optional filtering.

Property nameTypeRequiredPIIDescription
Availabilityenum<string>Optional

Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired.

Possible values:
internalbetapublicretired

LanguageCodestringOptional

Returns Custom Operators that support the provided language code.


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 listCustomOperator() {
11
const customOperators = await client.intelligence.v2.customOperators.list({
12
limit: 20,
13
});
14
15
customOperators.forEach((c) => console.log(c.accountSid));
16
}
17
18
listCustomOperator();

Output

1
{
2
"operators": [
3
{
4
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"sid": "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
6
"friendly_name": "My New Operator",
7
"description": "New Operator",
8
"author": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
9
"operator_type": "operator-type-name",
10
"version": 1,
11
"availability": "public",
12
"config": {
13
"configuration": {
14
"field": "value"
15
}
16
},
17
"date_created": "2010-08-31T20:36:28Z",
18
"date_updated": "2010-08-31T20:36:28Z",
19
"url": "https://intelligence.twilio.com/v2/Operators/Custom/LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
20
}
21
],
22
"meta": {
23
"first_page_url": "https://intelligence.twilio.com/v2/Operators/Custom?LanguageCode=en&Availability=public&PageSize=50&Page=0",
24
"key": "operators",
25
"next_page_url": null,
26
"page": 0,
27
"page_size": 50,
28
"previous_page_url": null,
29
"url": "https://intelligence.twilio.com/v2/Operators/Custom?LanguageCode=en&Availability=public&PageSize=50&Page=0"
30
}
31
}

Update a Custom Operator

update-a-custom-operator page anchor
POST https://intelligence.twilio.com/v2/Operators/Custom/{Sid}

This endpoint updates a Custom Operator.

Property nameTypeRequiredPIIDescription
If-MatchstringOptional

The If-Match HTTP request header

Property nameTypeRequiredPIIDescription
SidSID<LY>required

A 34 character string that uniquely identifies this Custom Operator.

Pattern: ^LY[0-9a-fA-F]{32}$Min length: 34Max length: 34
Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
FriendlyNamestringrequired

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


Configobjectrequired

Operator configuration, following the schema defined by the Operator Type.

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 updateCustomOperator() {
11
const customOperator = await client.intelligence.v2
12
.customOperators("LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.update({
14
config: {},
15
friendlyName: "FriendlyName",
16
});
17
18
console.log(customOperator.accountSid);
19
}
20
21
updateCustomOperator();

Output

1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"sid": "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"friendly_name": "FriendlyName",
5
"description": "My New Operator",
6
"author": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
7
"operator_type": "operator-type-name",
8
"version": 2,
9
"availability": "public",
10
"config": {
11
"configuration": {
12
"field": "value"
13
}
14
},
15
"date_created": "2010-08-31T20:36:28Z",
16
"date_updated": "2010-08-31T20:36:28Z",
17
"url": "https://intelligence.twilio.com/v2/Operators/Custom/LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
18
}

Delete a Custom Operator

delete-a-custom-operator page anchor
DELETE https://intelligence.twilio.com/v2/Operators/Custom/{Sid}

This endpoint deletes a Custom Operator.

Property nameTypeRequiredPIIDescription
SidSID<LY>required

A 34 character string that uniquely identifies this Custom Operator.

Pattern: ^LY[0-9a-fA-F]{32}$Min length: 34Max length: 34
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 deleteCustomOperator() {
11
await client.intelligence.v2
12
.customOperators("LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
13
.remove();
14
}
15
16
deleteCustomOperator();

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.