Skip to contentSkip to navigationSkip to topbar
On this page

OperatorAttachment Resource


The OperatorAttachment resource represents the link between a specific Prebuilt or Custom Operator and a specific Voice Intelligence Service. When an Operator is attached to a Service, it is available for use in that Service.


Operator Properties

operator-properties page anchor
Property nameTypeRequiredDescriptionChild properties
service_sidSID<GA>

Optional

Not PII

The unique SID identifier of the Service.

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

operator_sidSID<LY>

Optional

The unique SID identifier of the Operator.

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

urlstring<uri>

Optional

The URL of this resource.


Create an Operator attachment

create-an-operator-attachment page anchor
POST https://intelligence.twilio.com/v2/Services/{ServiceSid}/Operators/{OperatorSid}

This endpoint attaches an Operator to a Service.

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
ServiceSidSID<GA>required

The unique SID identifier of the Service.

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

OperatorSidSID<LY>required

The unique SID identifier of the Operator. Allows both Custom and Pre-built Operators.

Pattern: ^LY[0-9a-fA-F]{32}$Min length: 34Max length: 34
Create an OperatorLink to code sample: Create an Operator
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 createOperatorAttachment() {
11
const operatorAttachment = await client.intelligence.v2
12
.operatorAttachment(
13
"GAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
14
"LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
15
)
16
.create();
17
18
console.log(operatorAttachment.serviceSid);
19
}
20
21
createOperatorAttachment();

Output

1
{
2
"operator_sid": "LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"service_sid": "GAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"url": "https://intelligence.twilio.com/v2/Services/GAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Operators/LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
5
}

Delete an Operator attachment

delete-an-operator-attachment page anchor
DELETE https://intelligence.twilio.com/v2/Services/{ServiceSid}/Operators/{OperatorSid}

This endpoint detaches an Operator from a Service.

Property nameTypeRequiredPIIDescription
ServiceSidSID<GA>required

The unique SID identifier of the Service.

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

OperatorSidSID<LY>required

The unique SID identifier of the Operator. Allows both Custom and Pre-built Operators.

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 deleteOperatorAttachment() {
11
await client.intelligence.v2
12
.operatorAttachment(
13
"GAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
14
"LYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
15
)
16
.remove();
17
}
18
19
deleteOperatorAttachment();

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.