Intelligence API (v3) - Operators endpoints
Legal information
Conversation Intelligence, including the APIs, may use artificial intelligence or machine learning technologies and is subject to the terms of the Predictive and Generative AI/ML Features Addendum. For more details on AI usage and data, see AI Nutrition Facts for Conversation Intelligence.
Conversation Intelligence is not PCI compliant or a HIPAA Eligible Service and should not be used in workflows that are subject to HIPAA or PCI.
Conversations products are only available in the new Twilio Console. If your account hasn't been migrated, you'll be redirected to the legacy Console where these products won't appear.
Define and manage language operators. Conversational Intelligence uses GenAI-powered language operators to transform conversation text into structured insights.
Language operators produce structured outputs and can be reused across multiple intelligence configurations. Language operators are executed automatically according to rules you define.
Use Twilio-authored language operators for common use cases (Sentiment, Summary, Next Best Response, and Script Adherence) or create custom language operators to meet your business needs.
Create an Operator
Retrieve a list of Operators
Retrieve an Operator
Update an Operator
Delete an Operator
Retrieve a list of Operator Versions
Retrieve a specific Operator Version
POST/v3/ControlPlane/Operators
Base url: https://intelligence.twilio.com (Twilio Intelligence API)
Create a custom language operator. You can define a reusable, programmable conversational analysis task tailored to your business needs.
application/jsonThe unique identifier for the Language Operator. Assigned by Twilio (TTID).
intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5Pattern: ^intelligence_operator_[0-7][0-9a-z]{25}$Description of the Language Operator further explaining its purpose.
Numeric Operator version. Automatically incremented with each update on the resource, used to ensure integrity when updating the Operator.
The creator and maintainer of the Language Operator.
Available values:
SELF- Created and maintained by the customer (Custom Operator)TWILIO- Created and maintained by Twilio (Twilio-Authored Operator)
SELFTWILIOThe natural language instructions used by the operator to analyze the conversation.
Within the prompt, users can reference parameters using the {{parameters.[param_name]}} syntax. Parameter values are provided to the Operator by the Intelligence Configuration Rule at runtime.
Note: Prompts will only be exposed for Custom Operators (author = SELF). Twilio-authored Operators (author = TWILIO) will have their prompts omitted from the API.
The structure of the result returned by the Language Operator (specific to what the LLM returns, not the entirety of the Operator Result resource).
Available values:
TEXT: The Operator will return plaintext from the LLM.JSON: the Operator will return a structured object with schema defined inoutput_schemaCLASSIFICATION: The Operator will return the determined classifier string.
TEXTJSONCLASSIFICATIONRequired for JSON output only. this will be set to a JSON Schema object describing the properties & data types of the response. Please see https://platform.openai.com/docs/guides/structured-outputs#supported-schemas
Will include the following keywords:
type: Must be set toobjectproperties: An object containing the property names and their data types you would like the LLM to return
Additional details on JSON output formatting:
- The root level
typeof a JSON schema must be set toobject - The following property data types are supported :
string,number,boolean,integer,object,array,anyOf - Definitions with
$defs/$refare supported - Max 100 object properties and 10 levels of nesting are supported
- Max 1000 enum values across all enum properties are supported
- Notable JSON Schema keywords not supported include:
- For
strings:minLength,maxLength - For
objects:patternProperties,unevaluatedProperties,propertyNames,minProperties,maxProperties - For
arrays:unevaluatedItems,contains,minContains,maxContains,uniqueItems
- For
- Structured Operator Results will be returned in the same order as the ordering of keys in the schema
- In the event an Operator execution request is refused for safety reasons the Operator Result API response will include a new field called
refusalto indicate that the LLM refused to fulfill the request - Twilio will automatically set
additionalPropertiesto false and specify all provided fields as required (constraints of Structured Outputs). You don't need to pass these fields as part of your JSON schema. Twilio will automatically overwrite any user-provided values for these fields.
An array of example input/output pairs used to illustrate the intended behavior of the Language Operator. These examples help guide the model's understanding of expected input–output relationships and improve consistency during evaluation and testing.
Note: Training examples will only be exposed for Custom Operators (author = SELF). Twilio-authored Operators (author = TWILIO) will have their training examples omitted from the API.
Optionally specifies which contextual data sources (Memory, Knowledge) the operator can access during execution. Context objects will be passed in by the Intelligence Configuration Rule at runtime.
Note: this simply gives the LLM access to these context objects – ultimately the LLM will determine whether to actually call for context at runtime.
Defines the schema of the parameters that are provided when running the operator, including required and optional values that determine the operator's behavior. The values of the parameters themselves are passed in by the attached Intelligence Configuration.
Language Operator resource created.
The unique identifier for the Language Operator. Assigned by Twilio (TTID).
intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5Pattern: ^intelligence_operator_[0-7][0-9a-z]{25}$Description of the Language Operator further explaining its purpose.
Numeric Operator version. Automatically incremented with each update on the resource, used to ensure integrity when updating the Operator.
The creator and maintainer of the Language Operator.
Available values:
SELF- Created and maintained by the customer (Custom Operator)TWILIO- Created and maintained by Twilio (Twilio-Authored Operator)
SELFTWILIOThe natural language instructions used by the operator to analyze the conversation.
Within the prompt, users can reference parameters using the {{parameters.[param_name]}} syntax. Parameter values are provided to the Operator by the Intelligence Configuration Rule at runtime.
Note: Prompts will only be exposed for Custom Operators (author = SELF). Twilio-authored Operators (author = TWILIO) will have their prompts omitted from the API.
The structure of the result returned by the Language Operator (specific to what the LLM returns, not the entirety of the Operator Result resource).
Available values:
TEXT: The Operator will return plaintext from the LLM.JSON: the Operator will return a structured object with schema defined inoutput_schemaCLASSIFICATION: The Operator will return the determined classifier string.
TEXTJSONCLASSIFICATIONRequired for JSON output only. this will be set to a JSON Schema object describing the properties & data types of the response. Please see https://platform.openai.com/docs/guides/structured-outputs#supported-schemas
Will include the following keywords:
type: Must be set toobjectproperties: An object containing the property names and their data types you would like the LLM to return
Additional details on JSON output formatting:
- The root level
typeof a JSON schema must be set toobject - The following property data types are supported :
string,number,boolean,integer,object,array,anyOf - Definitions with
$defs/$refare supported - Max 100 object properties and 10 levels of nesting are supported
- Max 1000 enum values across all enum properties are supported
- Notable JSON Schema keywords not supported include:
- For
strings:minLength,maxLength - For
objects:patternProperties,unevaluatedProperties,propertyNames,minProperties,maxProperties - For
arrays:unevaluatedItems,contains,minContains,maxContains,uniqueItems
- For
- Structured Operator Results will be returned in the same order as the ordering of keys in the schema
- In the event an Operator execution request is refused for safety reasons the Operator Result API response will include a new field called
refusalto indicate that the LLM refused to fulfill the request - Twilio will automatically set
additionalPropertiesto false and specify all provided fields as required (constraints of Structured Outputs). You don't need to pass these fields as part of your JSON schema. Twilio will automatically overwrite any user-provided values for these fields.
An array of example input/output pairs used to illustrate the intended behavior of the Language Operator. These examples help guide the model's understanding of expected input–output relationships and improve consistency during evaluation and testing.
Note: Training examples will only be exposed for Custom Operators (author = SELF). Twilio-authored Operators (author = TWILIO) will have their training examples omitted from the API.
Optionally specifies which contextual data sources (Memory, Knowledge) the operator can access during execution. Context objects will be passed in by the Intelligence Configuration Rule at runtime.
Note: this simply gives the LLM access to these context objects – ultimately the LLM will determine whether to actually call for context at runtime.
Defines the schema of the parameters that are provided when running the operator, including required and optional values that determine the operator's behavior. The values of the parameters themselves are passed in by the attached Intelligence Configuration.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createOperator() {11const operator = await client.intelligence.v3.operators.create({12displayName: "displayName",13prompt: "prompt",14outputFormat: "TEXT",15});1617console.log(operator.id);18}1920createOperator();
Response
1{2"id": "intelligence_operator_01kcgy1ew0e9x8re6jq542zt8b",3"displayName": "Script Adherence",4"description": "Measuring whether the agent stuck to the script",5"version": 1,6"author": "SELF",7"prompt": "prompt",8"outputFormat": "JSON",9"outputSchema": {10"type": "object",11"properties": {12"score": {13"type": "integer"14},15"explanation": {16"type": "string"17}18},19"required": [20"score",21"explanation"22],23"additionalProperties": false24},25"trainingExamples": [26{27"input": "This is an example sentence which qualifies the lead as HOT.",28"output": "{\"score\": 5, \"explanation\": \"The agent followed the script closely and addressed all key points effectively.\"}"29}30],31"context": {32"memory": {33"enabled": true34},35"knowledge": {36"enabled": true37}38},39"parameters": {40"scale": {41"type": "integer",42"default": 5,43"description": "Maximum score for evaluating script adherence."44}45}46}
GET/v3/ControlPlane/Operators
Base url: https://intelligence.twilio.com (Twilio Intelligence API)
Retrieve a list of Operators for the account, including those not attached to an Intelligence Configuration. This request returns both Twilio-authored and custom language operators.
The maximum number of resources to return
50Minimum: 1Maximum: 1000Token for pagination
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listOperators() {11const operators = await client.intelligence.v3.operators.list({ limit: 20 });1213operators.forEach((o) => console.log(o.id));14}1516listOperators();
Response
1{2"items": [3{4"id": "intelligence_operator_01kcgy1ew0e9x8re6jq542zt8b",5"displayName": "Script Adherence",6"description": "Measuring whether the agent stuck to the script",7"version": 1,8"author": "SELF",9"prompt": "Your job is to determine if a contact center agent sticks to the script. Fetch the script from Knowledge using the Knowledge tool. Rate the interaction from 0-{{parameters.scale}}.",10"outputFormat": "JSON",11"outputSchema": {12"type": "object",13"properties": {14"score": {15"type": "integer"16},17"explanation": {18"type": "string"19}20},21"required": [22"score",23"explanation"24],25"additionalProperties": false26},27"trainingExamples": [28{29"input": "This is an example sentence which qualifies the lead as HOT.",30"output": "{\"score\": 5, \"explanation\": \"The agent followed the script closely and addressed all key points effectively.\"}"31}32],33"context": {34"memory": {35"enabled": true36},37"knowledge": {38"enabled": true39}40},41"parameters": {42"scale": {43"type": "integer",44"default": 5,45"description": "Maximum score for evaluating script adherence."46}47}48},49{50"id": "intelligence_operator_01kcgy1ew0e9x8re6jq542zt9c",51"displayName": "Sentiment Analysis",52"description": "Analyze customer sentiment throughout the conversation",53"version": 2,54"author": "TWILIO",55"outputFormat": "CLASSIFICATION",56"context": {57"memory": {58"enabled": false59},60"knowledge": {61"enabled": false62}63},64"parameters": {}65}66],67"meta": {68"key": "items",69"pageSize": 2,70"nextToken": "next_page_token_example"71}72}
GET/v3/ControlPlane/Operators/{id}
Base url: https://intelligence.twilio.com (Twilio Intelligence API)
The unique identifier (TTID) of the Language Operator.
intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5Pattern: ^intelligence_operator_[0-7][0-9a-z]{25}$A Language Operator resource.
The unique identifier for the Language Operator. Assigned by Twilio (TTID).
intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5Pattern: ^intelligence_operator_[0-7][0-9a-z]{25}$Description of the Language Operator further explaining its purpose.
Numeric Operator version. Automatically incremented with each update on the resource, used to ensure integrity when updating the Operator.
The creator and maintainer of the Language Operator.
Available values:
SELF- Created and maintained by the customer (Custom Operator)TWILIO- Created and maintained by Twilio (Twilio-Authored Operator)
SELFTWILIOThe natural language instructions used by the operator to analyze the conversation.
Within the prompt, users can reference parameters using the {{parameters.[param_name]}} syntax. Parameter values are provided to the Operator by the Intelligence Configuration Rule at runtime.
Note: Prompts will only be exposed for Custom Operators (author = SELF). Twilio-authored Operators (author = TWILIO) will have their prompts omitted from the API.
The structure of the result returned by the Language Operator (specific to what the LLM returns, not the entirety of the Operator Result resource).
Available values:
TEXT: The Operator will return plaintext from the LLM.JSON: the Operator will return a structured object with schema defined inoutput_schemaCLASSIFICATION: The Operator will return the determined classifier string.
TEXTJSONCLASSIFICATIONRequired for JSON output only. this will be set to a JSON Schema object describing the properties & data types of the response. Please see https://platform.openai.com/docs/guides/structured-outputs#supported-schemas
Will include the following keywords:
type: Must be set toobjectproperties: An object containing the property names and their data types you would like the LLM to return
Additional details on JSON output formatting:
- The root level
typeof a JSON schema must be set toobject - The following property data types are supported :
string,number,boolean,integer,object,array,anyOf - Definitions with
$defs/$refare supported - Max 100 object properties and 10 levels of nesting are supported
- Max 1000 enum values across all enum properties are supported
- Notable JSON Schema keywords not supported include:
- For
strings:minLength,maxLength - For
objects:patternProperties,unevaluatedProperties,propertyNames,minProperties,maxProperties - For
arrays:unevaluatedItems,contains,minContains,maxContains,uniqueItems
- For
- Structured Operator Results will be returned in the same order as the ordering of keys in the schema
- In the event an Operator execution request is refused for safety reasons the Operator Result API response will include a new field called
refusalto indicate that the LLM refused to fulfill the request - Twilio will automatically set
additionalPropertiesto false and specify all provided fields as required (constraints of Structured Outputs). You don't need to pass these fields as part of your JSON schema. Twilio will automatically overwrite any user-provided values for these fields.
An array of example input/output pairs used to illustrate the intended behavior of the Language Operator. These examples help guide the model's understanding of expected input–output relationships and improve consistency during evaluation and testing.
Note: Training examples will only be exposed for Custom Operators (author = SELF). Twilio-authored Operators (author = TWILIO) will have their training examples omitted from the API.
Optionally specifies which contextual data sources (Memory, Knowledge) the operator can access during execution. Context objects will be passed in by the Intelligence Configuration Rule at runtime.
Note: this simply gives the LLM access to these context objects – ultimately the LLM will determine whether to actually call for context at runtime.
Defines the schema of the parameters that are provided when running the operator, including required and optional values that determine the operator's behavior. The values of the parameters themselves are passed in by the attached Intelligence Configuration.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchOperator() {11const operator = await client.intelligence.v312.operators("intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5")13.fetch();1415console.log(operator.id);16}1718fetchOperator();
Response
1{2"id": "intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5",3"displayName": "Script Adherence",4"description": "Measuring whether the agent stuck to the script",5"version": 1,6"author": "SELF",7"prompt": "Your job is to determine if a contact center agent sticks to the script. Fetch the script from Knowledge using the Knowledge tool. Rate the interaction from 0-{{parameters.scale}}.",8"outputFormat": "JSON",9"outputSchema": {10"type": "object",11"properties": {12"score": {13"type": "integer"14},15"explanation": {16"type": "string"17}18},19"required": [20"score",21"explanation"22],23"additionalProperties": false24},25"trainingExamples": [26{27"input": "This is an example sentence which qualifies the lead as HOT.",28"output": "{\"score\": 5, \"explanation\": \"The agent followed the script closely and addressed all key points effectively.\"}"29}30],31"context": {32"memory": {33"enabled": true34},35"knowledge": {36"enabled": true37}38},39"parameters": {40"scale": {41"type": "integer",42"default": 5,43"description": "Maximum score for evaluating script adherence."44}45}46}
PUT/v3/ControlPlane/Operators/{id}
Base url: https://intelligence.twilio.com (Twilio Intelligence API)
Current ETag/version required for conditional update
The unique identifier (TTID) of the Language Operator.
intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5Pattern: ^intelligence_operator_[0-7][0-9a-z]{25}$application/jsonThe unique identifier for the Language Operator. Assigned by Twilio (TTID).
intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5Pattern: ^intelligence_operator_[0-7][0-9a-z]{25}$Description of the Language Operator further explaining its purpose.
Numeric Operator version. Automatically incremented with each update on the resource, used to ensure integrity when updating the Operator.
The creator and maintainer of the Language Operator.
Available values:
SELF- Created and maintained by the customer (Custom Operator)TWILIO- Created and maintained by Twilio (Twilio-Authored Operator)
SELFTWILIOThe natural language instructions used by the operator to analyze the conversation.
Within the prompt, users can reference parameters using the {{parameters.[param_name]}} syntax. Parameter values are provided to the Operator by the Intelligence Configuration Rule at runtime.
Note: Prompts will only be exposed for Custom Operators (author = SELF). Twilio-authored Operators (author = TWILIO) will have their prompts omitted from the API.
The structure of the result returned by the Language Operator (specific to what the LLM returns, not the entirety of the Operator Result resource).
Available values:
TEXT: The Operator will return plaintext from the LLM.JSON: the Operator will return a structured object with schema defined inoutput_schemaCLASSIFICATION: The Operator will return the determined classifier string.
TEXTJSONCLASSIFICATIONRequired for JSON output only. this will be set to a JSON Schema object describing the properties & data types of the response. Please see https://platform.openai.com/docs/guides/structured-outputs#supported-schemas
Will include the following keywords:
type: Must be set toobjectproperties: An object containing the property names and their data types you would like the LLM to return
Additional details on JSON output formatting:
- The root level
typeof a JSON schema must be set toobject - The following property data types are supported :
string,number,boolean,integer,object,array,anyOf - Definitions with
$defs/$refare supported - Max 100 object properties and 10 levels of nesting are supported
- Max 1000 enum values across all enum properties are supported
- Notable JSON Schema keywords not supported include:
- For
strings:minLength,maxLength - For
objects:patternProperties,unevaluatedProperties,propertyNames,minProperties,maxProperties - For
arrays:unevaluatedItems,contains,minContains,maxContains,uniqueItems
- For
- Structured Operator Results will be returned in the same order as the ordering of keys in the schema
- In the event an Operator execution request is refused for safety reasons the Operator Result API response will include a new field called
refusalto indicate that the LLM refused to fulfill the request - Twilio will automatically set
additionalPropertiesto false and specify all provided fields as required (constraints of Structured Outputs). You don't need to pass these fields as part of your JSON schema. Twilio will automatically overwrite any user-provided values for these fields.
An array of example input/output pairs used to illustrate the intended behavior of the Language Operator. These examples help guide the model's understanding of expected input–output relationships and improve consistency during evaluation and testing.
Note: Training examples will only be exposed for Custom Operators (author = SELF). Twilio-authored Operators (author = TWILIO) will have their training examples omitted from the API.
Optionally specifies which contextual data sources (Memory, Knowledge) the operator can access during execution. Context objects will be passed in by the Intelligence Configuration Rule at runtime.
Note: this simply gives the LLM access to these context objects – ultimately the LLM will determine whether to actually call for context at runtime.
Defines the schema of the parameters that are provided when running the operator, including required and optional values that determine the operator's behavior. The values of the parameters themselves are passed in by the attached Intelligence Configuration.
Updated Language Operator resource.
The unique identifier for the Language Operator. Assigned by Twilio (TTID).
intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5Pattern: ^intelligence_operator_[0-7][0-9a-z]{25}$Description of the Language Operator further explaining its purpose.
Numeric Operator version. Automatically incremented with each update on the resource, used to ensure integrity when updating the Operator.
The creator and maintainer of the Language Operator.
Available values:
SELF- Created and maintained by the customer (Custom Operator)TWILIO- Created and maintained by Twilio (Twilio-Authored Operator)
SELFTWILIOThe natural language instructions used by the operator to analyze the conversation.
Within the prompt, users can reference parameters using the {{parameters.[param_name]}} syntax. Parameter values are provided to the Operator by the Intelligence Configuration Rule at runtime.
Note: Prompts will only be exposed for Custom Operators (author = SELF). Twilio-authored Operators (author = TWILIO) will have their prompts omitted from the API.
The structure of the result returned by the Language Operator (specific to what the LLM returns, not the entirety of the Operator Result resource).
Available values:
TEXT: The Operator will return plaintext from the LLM.JSON: the Operator will return a structured object with schema defined inoutput_schemaCLASSIFICATION: The Operator will return the determined classifier string.
TEXTJSONCLASSIFICATIONRequired for JSON output only. this will be set to a JSON Schema object describing the properties & data types of the response. Please see https://platform.openai.com/docs/guides/structured-outputs#supported-schemas
Will include the following keywords:
type: Must be set toobjectproperties: An object containing the property names and their data types you would like the LLM to return
Additional details on JSON output formatting:
- The root level
typeof a JSON schema must be set toobject - The following property data types are supported :
string,number,boolean,integer,object,array,anyOf - Definitions with
$defs/$refare supported - Max 100 object properties and 10 levels of nesting are supported
- Max 1000 enum values across all enum properties are supported
- Notable JSON Schema keywords not supported include:
- For
strings:minLength,maxLength - For
objects:patternProperties,unevaluatedProperties,propertyNames,minProperties,maxProperties - For
arrays:unevaluatedItems,contains,minContains,maxContains,uniqueItems
- For
- Structured Operator Results will be returned in the same order as the ordering of keys in the schema
- In the event an Operator execution request is refused for safety reasons the Operator Result API response will include a new field called
refusalto indicate that the LLM refused to fulfill the request - Twilio will automatically set
additionalPropertiesto false and specify all provided fields as required (constraints of Structured Outputs). You don't need to pass these fields as part of your JSON schema. Twilio will automatically overwrite any user-provided values for these fields.
An array of example input/output pairs used to illustrate the intended behavior of the Language Operator. These examples help guide the model's understanding of expected input–output relationships and improve consistency during evaluation and testing.
Note: Training examples will only be exposed for Custom Operators (author = SELF). Twilio-authored Operators (author = TWILIO) will have their training examples omitted from the API.
Optionally specifies which contextual data sources (Memory, Knowledge) the operator can access during execution. Context objects will be passed in by the Intelligence Configuration Rule at runtime.
Note: this simply gives the LLM access to these context objects – ultimately the LLM will determine whether to actually call for context at runtime.
Defines the schema of the parameters that are provided when running the operator, including required and optional values that determine the operator's behavior. The values of the parameters themselves are passed in by the attached Intelligence Configuration.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updateOperator() {11const operator = await client.intelligence.v312.operators("intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5")13.update({14displayName: "displayName",15prompt: "prompt",16outputFormat: "TEXT",17});1819console.log(operator.id);20}2122updateOperator();
Response
1{2"id": "intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5",3"displayName": "Script Adherence",4"description": "Measuring whether the agent stuck to the script",5"version": 1,6"author": "SELF",7"prompt": "prompt",8"outputFormat": "JSON",9"outputSchema": {10"type": "object",11"properties": {12"score": {13"type": "integer"14},15"explanation": {16"type": "string"17}18},19"required": [20"score",21"explanation"22],23"additionalProperties": false24},25"trainingExamples": [26{27"input": "This is an example sentence which qualifies the lead as HOT.",28"output": "{\"score\": 5, \"explanation\": \"The agent followed the script closely and addressed all key points effectively.\"}"29}30],31"context": {32"memory": {33"enabled": true34},35"knowledge": {36"enabled": true37}38},39"parameters": {40"scale": {41"type": "integer",42"default": 5,43"description": "Maximum score for evaluating script adherence."44}45}46}
DELETE/v3/ControlPlane/Operators/{id}
Base url: https://intelligence.twilio.com (Twilio Intelligence API)
The unique identifier (TTID) of the Language Operator.
intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5Pattern: ^intelligence_operator_[0-7][0-9a-z]{25}$Language Operator deleted
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function deleteOperator() {11await client.intelligence.v312.operators("intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5")13.remove();14}1516deleteOperator();
GET/v3/ControlPlane/Operators/{id}/Versions
Base url: https://intelligence.twilio.com (Twilio Intelligence API)
Retrieve a paginated list of all versions for a given Language Operator.
The unique identifier (TTID) of the Language Operator.
intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5Pattern: ^intelligence_operator_[0-7][0-9a-z]{25}$The maximum number of resources to return
50Minimum: 1Maximum: 1000Token for pagination
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listOperatorVersions() {11const versions = await client.intelligence.v312.versions("intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5")13.list({ limit: 20 });1415versions.forEach((v) => console.log(v.version));16}1718listOperatorVersions();
Response
1{2"items": [3{4"version": 5,5"status": "PREVIEW",6"dateCreated": "2026-02-10T14:00:00Z"7},8{9"version": 4,10"status": "ACTIVE",11"dateCreated": "2026-01-15T10:45:30Z"12},13{14"version": 3,15"status": "DEPRECATED",16"dateDeprecated": "2026-01-10T00:00:00Z",17"retirementDate": "2026-04-10T00:00:00Z",18"dateCreated": "2025-11-01T08:00:00Z"19},20{21"version": 2,22"status": "RETIRED",23"dateDeprecated": "2025-09-01T00:00:00Z",24"dateRetired": "2025-12-01T00:00:00Z",25"dateCreated": "2025-06-15T12:00:00Z"26}27],28"meta": {29"key": "items",30"pageSize": 431}32}
GET/v3/ControlPlane/Operators/{id}/Versions/{version}
Base url: https://intelligence.twilio.com (Twilio Intelligence API)
The unique identifier (TTID) of the Language Operator.
intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5Pattern: ^intelligence_operator_[0-7][0-9a-z]{25}$The numeric version number of the Language Operator.
A specific Language Operator version.
The unique identifier for the Language Operator. Assigned by Twilio (TTID).
intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5Pattern: ^intelligence_operator_[0-7][0-9a-z]{25}$Description of the Language Operator further explaining its purpose.
Numeric Operator version. Automatically incremented with each update on the resource, used to ensure integrity when updating the Operator.
The creator and maintainer of the Language Operator.
Available values:
SELF- Created and maintained by the customer (Custom Operator)TWILIO- Created and maintained by Twilio (Twilio-Authored Operator)
SELFTWILIOThe natural language instructions used by the operator to analyze the conversation.
Within the prompt, users can reference parameters using the {{parameters.[param_name]}} syntax. Parameter values are provided to the Operator by the Intelligence Configuration Rule at runtime.
Note: Prompts will only be exposed for Custom Operators (author = SELF). Twilio-authored Operators (author = TWILIO) will have their prompts omitted from the API.
The structure of the result returned by the Language Operator (specific to what the LLM returns, not the entirety of the Operator Result resource).
Available values:
TEXT: The Operator will return plaintext from the LLM.JSON: the Operator will return a structured object with schema defined inoutput_schemaCLASSIFICATION: The Operator will return the determined classifier string.
TEXTJSONCLASSIFICATIONRequired for JSON output only. this will be set to a JSON Schema object describing the properties & data types of the response. Please see https://platform.openai.com/docs/guides/structured-outputs#supported-schemas
Will include the following keywords:
type: Must be set toobjectproperties: An object containing the property names and their data types you would like the LLM to return
Additional details on JSON output formatting:
- The root level
typeof a JSON schema must be set toobject - The following property data types are supported :
string,number,boolean,integer,object,array,anyOf - Definitions with
$defs/$refare supported - Max 100 object properties and 10 levels of nesting are supported
- Max 1000 enum values across all enum properties are supported
- Notable JSON Schema keywords not supported include:
- For
strings:minLength,maxLength - For
objects:patternProperties,unevaluatedProperties,propertyNames,minProperties,maxProperties - For
arrays:unevaluatedItems,contains,minContains,maxContains,uniqueItems
- For
- Structured Operator Results will be returned in the same order as the ordering of keys in the schema
- In the event an Operator execution request is refused for safety reasons the Operator Result API response will include a new field called
refusalto indicate that the LLM refused to fulfill the request - Twilio will automatically set
additionalPropertiesto false and specify all provided fields as required (constraints of Structured Outputs). You don't need to pass these fields as part of your JSON schema. Twilio will automatically overwrite any user-provided values for these fields.
An array of example input/output pairs used to illustrate the intended behavior of the Language Operator. These examples help guide the model's understanding of expected input–output relationships and improve consistency during evaluation and testing.
Note: Training examples will only be exposed for Custom Operators (author = SELF). Twilio-authored Operators (author = TWILIO) will have their training examples omitted from the API.
Optionally specifies which contextual data sources (Memory, Knowledge) the operator can access during execution. Context objects will be passed in by the Intelligence Configuration Rule at runtime.
Note: this simply gives the LLM access to these context objects – ultimately the LLM will determine whether to actually call for context at runtime.
Defines the schema of the parameters that are provided when running the operator, including required and optional values that determine the operator's behavior. The values of the parameters themselves are passed in by the attached Intelligence Configuration.
The lifecycle status of an Operator version.
Available values:
PREVIEW: Available but restricted to internal/testing visibility. Normal execution.ACTIVE: Available for normal use.DEPRECATED: Still executes normally, but a Warn event is emitted via the Watch product lifecycle system. Customers should migrate to a newer version.RETIRED: Hard failure on execution. An Error is logged in Watch. Customers must manually update their Intelligence Configuration to a valid version.
PREVIEWACTIVEDEPRECATEDRETIREDTimestamp of when this version was created.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchOperatorVersion() {11const version = await client.intelligence.v312.versions("intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5", 42)13.fetch();1415console.log(version.id);16}1718fetchOperatorVersion();
Response
1{2"id": "intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5",3"version": 42,4"status": "ACTIVE",5"displayName": "Sentiment Analysis",6"description": "Analyzes conversation sentiment",7"author": "TWILIO",8"outputFormat": "JSON",9"outputSchema": {},10"context": {},11"parameters": {},12"trainingExamples": [],13"dateCreated": "2026-01-15T10:45:30Z"14}