Custom language operator examples
This guide provides ready-to-use custom language operator examples you can create directly using the API. Each example includes the full API request so you can copy, customize, and deploy.
You can create custom language operators for both real-time and post-conversation use cases. To add operators to your intelligence configuration, see Define rules.
Real-time operators analyze conversations as they happen. Use these for live agent assist, in-conversation guidance, and triggering automations based on conversation signals.
Post-conversation operators analyze completed interactions. Use these for contact center QA, agent coaching, and sales workflow automation.
Detects organic upsell opportunities during live conversations, recommends relevant offers to the agent, and tracks whether the agent completed the upsell.
This operator uses Conversation Memory to understand the customer's purchase history and preferences, and Enterprise Knowledge to reference current promotions and product catalog.
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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function createOperator() {14const operator = await client.intelligence.v3.operators.create({15displayName: "Upsell Opportunity Detection",16description:17"Detects upsell opportunities and recommends relevant offers based on conversation context and customer history.",18prompt:19"Analyze this conversation for organic upsell opportunities. Consider the customer's expressed needs, pain points, and any openings where additional products or services would genuinely help them. If an opportunity exists, recommend a specific upsell and provide talk track guidance. Also determine if the agent has already attempted or completed an upsell.",20outputFormat: "JSON",21outputSchema: {22type: "object",23properties: {24opportunityDetected: {25type: "boolean",26},27opportunityType: {28type: "string",29},30recommendedOffer: {31type: "string",32},33talkTrack: {34type: "string",35},36agentAttemptedUpsell: {37type: "boolean",38},39upsellOutcome: {40type: "string",41enum: [42"not_attempted",43"attempted_accepted",44"attempted_declined",45"pending",46],47},48},49},50context: {51knowledge: {52enabled: true,53},54},55});5657console.log(operator.id);58}5960createOperator();
The following shows the full OperatorResult response structure.
1{2"id": "intelligence_operatorresult_01k6fc25s7epm9qtk8rszbv3q5",3"accountId": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",4"outputFormat": "JSON",5"intelligenceConfiguration": {6"id": "intelligence_configuration_01k6fc25s7epm9qtk8rszbv3q5",7"ruleId": "intelligence_configurationrule_01k6fc25s7epm9qtk8rszbv3q6",8"version": 19},10"conversationId": "conv_conversation_01k1etk2y5f1y9fpe2epfdtvv2",11"operator": {12"id": "intelligence_operator_01k6fc25s7epm9qtk8rszbv3q5",13"version": 114},15"dateCreated": "2026-01-17T14:32:00Z",16"executionDetails": {17"trigger": {18"on": "COMMUNICATION",19"timestamp": "2026-01-17T14:31:58Z"20},21"communications": {22"first": "conv_communication_01k1etk2y5f1y9fpe2epfdtvv2",23"last": "conv_communication_01k1etk2y5f1y9fpe2epfdtvv3"24},25"channels": ["voice"],26"participants": [27{28"id": "conv_participant_01k1etx3jbfx88476ccja0889c",29"profileId": "mem_profile_01k1etx3jbfx88476ccja0889d",30"type": "CUSTOMER"31},32{33"id": "conv_participant_01k1etx3jbfx88476ccja0889e",34"type": "HUMAN_AGENT"35}36],37"context": {38"customerMemory": {39"enabled": true40},41"knowledge": {42"bases": ["knowledge_base_01k1etx3jbfx88476ccja0889f"]43}44}45},46"result": {47"opportunityDetected": true,48"opportunityType": "plan_upgrade",49"recommendedOffer": "Premium Support Package",50"talkTrack": "Based on the technical issues you've mentioned, our Premium Support Package includes priority response times and a dedicated account manager who could help resolve these faster.",51"agentAttemptedUpsell": false,52"upsellOutcome": "not_attempted"53}54}
Monitors live conversations to detect signals that a customer interaction is at risk of escalation. This includes sudden negative sentiment shifts and explicit escalation cues such as requests for a supervisor, expressions of frustration, or threats to churn.
This operator uses a configurable sensitivity parameter to control how aggressively escalation signals are flagged.
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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function createOperator() {14const operator = await client.intelligence.v3.operators.create({15displayName: "Escalation Risk Detection",16description:17"Detects escalation risk signals in real-time, including sentiment shifts and explicit escalation cues.",18prompt:19"Analyze this conversation for escalation risk. Look for: (1) sudden negative sentiment shifts, (2) explicit requests for supervisor or manager, (3) expressions of frustration or anger, (4) threats to cancel, churn, or take business elsewhere, (5) repeated unresolved complaints. Rate the escalation risk on a scale of 1-{{parameters.maxRiskLevel}} where {{parameters.maxRiskLevel}} is highest risk. Return the risk as a ratio (e.g., 8/10).",20outputFormat: "JSON",21outputSchema: {22type: "object",23properties: {24escalationRisk: {25type: "string",26},27riskLevel: {28type: "string",29enum: ["low", "medium", "high", "critical"],30},31triggerSignals: {32type: "array",33items: {34type: "string",35},36},37recommendedAction: {38type: "string",39},40verbatimCue: {41type: "string",42},43},44},45parameters: {46maxRiskLevel: {47type: "INTEGER",48default: 10,49required: false,50description: "Maximum value for the escalation risk scale.",51},52},53});5455console.log(operator.id);56}5758createOperator();
The following response example shows the result property of the OperatorResult. To view the full response structure, see the Upsell Opportunity Detection example.
12{3"escalationRisk": "8/10",4"riskLevel": "high",5"triggerSignals": [6"explicit_frustration",7"supervisor_request",8"churn_threat"9],10"recommendedAction": "Acknowledge frustration, offer immediate resolution or warm transfer to supervisor.",11"verbatimCue": "This is ridiculous. I've been a customer for 5 years and I want to speak to your manager."12}
Translates customer messages in real-time to a language spoken by the agent. Particularly useful for messaging channels where customers may communicate in their preferred language.
This operator uses a configurable target language parameter to specify the agent's language.
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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function createOperator() {14const operator = await client.intelligence.v3.operators.create({15displayName: "Live Translation",16description:17"Translates customer messages to the agent's preferred language in real-time.",18prompt:19"Translate the customer's most recent message to {{parameters.targetLanguage}}. Customer messages in the transcript are prefixed with CUSTOMER:. Preserve the original tone and intent. If the message is already in {{parameters.targetLanguage}}, return it unchanged. Also detect the source language.",20outputFormat: "JSON",21outputSchema: {22type: "object",23properties: {24detectedLanguage: {25type: "string",26},27translatedMessage: {28type: "string",29},30translationNeeded: {31type: "boolean",32},33confidenceScore: {34type: "number",35},36},37},38parameters: {39targetLanguage: {40type: "STRING",41default: "English",42required: true,43description: "The language to translate customer messages into.",44},45},46});4748console.log(operator.id);49}5051createOperator();
The following response example shows the result property of the OperatorResult. To view the full response structure, see the Upsell Opportunity Detection example.
1{2"detectedLanguage": "Spanish",3"translatedMessage": "I need help with my account. I was charged twice for my subscription last month and I want a refund.",4"translationNeeded": true,5"confidenceScore": 0.976}
Flags language patterns associated with fraud, abuse, or suspicious behavior during live interactions. Detects social engineering attempts, account takeover signals, and policy abuse indicators.
This operator uses Conversation Memory to check account history for prior suspicious activity, and Enterprise Knowledge to reference known fraud patterns and red flags.
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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function createOperator() {14const operator = await client.intelligence.v3.operators.create({15displayName: "Risk/Fraud Signal Detection",16description:17"Detects fraud, abuse, and suspicious behavior patterns in real-time conversations.",18prompt:19"Analyze this conversation for fraud and abuse signals. Look for: (1) social engineering attempts (urgency, authority claims, information fishing), (2) account takeover indicators (unable to verify identity, requesting credential changes), (3) policy abuse patterns (excessive refund requests, false claims), (4) suspicious inconsistencies in the customer's story. Flag any signals detected and assess overall risk level.",20outputFormat: "JSON",21outputSchema: {22type: "object",23properties: {24fraudRiskDetected: {25type: "boolean",26},27riskLevel: {28type: "string",29enum: ["none", "low", "medium", "high", "critical"],30},31signalsDetected: {32type: "array",33items: {34type: "string",35},36},37signalCategory: {38type: "string",39enum: [40"social_engineering",41"account_takeover",42"policy_abuse",43"suspicious_behavior",44"none",45],46},47evidence: {48type: "string",49},50recommendedAction: {51type: "string",52},53},54},55context: {56knowledge: {57enabled: true,58},59},60});6162console.log(operator.id);63}6465createOperator();
The following response example shows the result property of the OperatorResult. To view the full response structure, see the Upsell Opportunity Detection example.
1{2"fraudRiskDetected": true,3"riskLevel": "high",4"signalsDetected": [5"urgency_pressure",6"identity_verification_avoidance",7"credential_change_request"8],9"signalCategory": "account_takeover",10"evidence": "Caller claimed to be traveling and unable to access verification email, pressured agent to skip security questions, immediately requested password and email change.",11"recommendedAction": "Do not proceed with account changes. Escalate to fraud team for verification callback to number on file."12}
Detects whether required disclosures, confirmations, or policy statements were delivered while the conversation is still happening. Enables real-time compliance monitoring and alerts agents to missing requirements before the conversation ends.
This operator uses Enterprise Knowledge to reference the specific compliance requirements, and a parameter to specify which policy document to check against.
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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function createOperator() {14const operator = await client.intelligence.v3.operators.create({15displayName: "Compliance/Disclosure Detection",16description:17"Monitors conversations for required disclosures and compliance statements in real-time.",18prompt:19"Review this conversation and check whether the agent has delivered the required disclosures and compliance statements defined in the policy document. For each requirement, indicate whether it was met, partially met, or missing. Flag any outstanding requirements that must still be addressed before the conversation ends.\n\nPolicy document:\n{{parameters.policyDocument}}",20outputFormat: "JSON",21outputSchema: {22type: "object",23properties: {24allRequirementsMet: {25type: "boolean",26},27requirementsChecked: {28type: "array",29items: {30type: "object",31properties: {32requirement: {33type: "string",34},35status: {36type: "string",37enum: ["met", "partially_met", "missing"],38},39verbatim: {40type: "string",41},42},43},44},45outstandingRequirements: {46type: "array",47items: {48type: "string",49},50},51complianceScore: {52type: "string",53},54urgentAlert: {55type: "boolean",56},57},58},59context: {60knowledge: {61enabled: true,62},63},64parameters: {65policyDocument: {66type: "KNOWLEDGE_BASE_AND_SOURCE_IDS",67required: true,68description:69"The compliance policy document to check requirements against.",70},71},72});7374console.log(operator.id);75}7677createOperator();
The following response example shows the result property of the OperatorResult. To view the full response structure, see the Upsell Opportunity Detection example.
1{2"allRequirementsMet": false,3"requirementsChecked": [4{5"requirement": "Call recording disclosure",6"status": "met",7"verbatim": "This call may be recorded for quality assurance purposes."8},9{10"requirement": "Identity verification",11"status": "met",12"verbatim": "Can you please confirm your date of birth and the last four digits of your SSN?"13},14{15"requirement": "Fee disclosure",16"status": "missing",17"verbatim": ""18}19],20"outstandingRequirements": [21"Fee disclosure: Agent must disclose the $25 processing fee before completing the transaction."22],23"complianceScore": "2/3",24"urgentAlert": true25}
Identifies real-time objections as they arise in the conversation—such as concerns about price, timing, trust, or competition—and surfaces objection-handling guidance to help the agent respond effectively.
This operator uses Enterprise Knowledge to reference your objection-handling playbook and product information.
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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function createOperator() {14const operator = await client.intelligence.v3.operators.create({15displayName: "Objection Handling",16description:17"Identifies customer objections in real-time and provides guidance for addressing them.",18prompt:19"Analyze this conversation for customer objections. Identify the type of objection (price, timing, trust, competition, authority, need, or other) and provide specific guidance on how the agent should respond. Reference relevant product information and proven objection-handling techniques.",20outputFormat: "JSON",21outputSchema: {22type: "object",23properties: {24objectionDetected: {25type: "boolean",26},27objectionType: {28type: "string",29enum: [30"price",31"timing",32"trust",33"competition",34"authority",35"need",36"other",37"none",38],39},40customerStatement: {41type: "string",42},43suggestedResponse: {44type: "string",45},46supportingPoints: {47type: "array",48items: {49type: "string",50},51},52toneGuidance: {53type: "string",54},55},56},57context: {58knowledge: {59enabled: true,60},61},62});6364console.log(operator.id);65}6667createOperator();
The following response example shows the result property of the OperatorResult. To view the full response structure, see the Upsell Opportunity Detection example.
1{2"objectionDetected": true,3"objectionType": "price",4"customerStatement": "That's more expensive than what we're currently paying with our existing provider.",5"suggestedResponse": "I understand budget is important. Many of our customers initially felt the same way, but found that our solution reduced their total cost of ownership by 30% within the first year through reduced maintenance and improved efficiency.",6"supportingPoints": [7"Highlight included features that competitors charge extra for",8"Mention the dedicated support included at no additional cost",9"Offer to provide a total cost of ownership comparison"10],11"toneGuidance": "Acknowledge the concern without being defensive. Focus on value rather than defending the price."12}
Assigns a quality score to completed conversations based on agent performance criteria. Use for contact center QA, agent coaching, and performance tracking.
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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function createOperator() {14const operator = await client.intelligence.v3.operators.create({15displayName: "Conversation Scoring",16description:17"Scores completed conversations based on agent performance and customer experience criteria.",18prompt:19"Evaluate this completed conversation and assign a score from 1-10 based on the following criteria:\n\n- Professionalism (25%): Was the agent friendly, clear, and professional throughout?\n- Problem Resolution (35%): Did the agent effectively resolve the customer’s issue?\n- Communication (20%): Did the agent communicate clearly and listen actively?\n- Efficiency (20%): Was the conversation handled efficiently without unnecessary delays?\n\nProvide an overall score, individual category scores, and specific feedback for coaching.",20outputFormat: "JSON",21outputSchema: {22type: "object",23properties: {24overallScore: {25type: "string",26},27categoryScores: {28type: "object",29properties: {30professionalism: {31type: "string",32},33problemResolution: {34type: "string",35},36communication: {37type: "string",38},39efficiency: {40type: "string",41},42},43},44strengths: {45type: "array",46items: {47type: "string",48},49},50improvementAreas: {51type: "array",52items: {53type: "string",54},55},56coachingNotes: {57type: "string",58},59},60},61});6263console.log(operator.id);64}6566createOperator();
The following response example shows the result property of the OperatorResult. To view the full response structure, see the Upsell Opportunity Detection example.
1{2"overallScore": "8/10",3"categoryScores": {4"professionalism": "9/10",5"problemResolution": "8/10",6"communication": "8/10",7"efficiency": "7/10"8},9"strengths": [10"Maintained a friendly and empathetic tone throughout",11"Successfully resolved the billing dispute",12"Clearly explained the resolution and next steps"13],14"improvementAreas": [15"Took longer than necessary to locate the customer's account",16"Could have proactively offered a goodwill credit earlier"17],18"coachingNotes": "Strong customer rapport. Focus on improving familiarity with the billing system to reduce handle time."19}
Analyzes completed sales conversations to qualify leads based on buying signals and readiness indicators. Use for sales pipeline prioritization and follow-up automation.
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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function createOperator() {14const operator = await client.intelligence.v3.operators.create({15displayName: "Lead Qualification",16description:17"Qualifies leads based on buying signals and readiness indicators from sales conversations.",18prompt:19"Analyze this sales conversation and qualify the lead. Identify buying signals such as pricing inquiries, timeline discussions, decision-maker involvement, and budget mentions. Classify the lead's likelihood to close and recommend appropriate follow-up actions.",20outputFormat: "JSON",21outputSchema: {22type: "object",23properties: {24leadScore: {25type: "string",26},27leadCategory: {28type: "string",29enum: ["hot", "warm", "cold", "disqualified"],30},31buyingSignals: {32type: "array",33items: {34type: "string",35},36},37concerns: {38type: "array",39items: {40type: "string",41},42},43decisionMakerInvolved: {44type: "boolean",45},46estimatedTimeline: {47type: "string",48},49recommendedFollowUp: {50type: "string",51},52nextSteps: {53type: "array",54items: {55type: "string",56},57},58},59},60});6162console.log(operator.id);63}6465createOperator();
1{2"leadScore": "8/10",3"leadCategory": "hot",4"buyingSignals": [5"Asked about annual pricing discounts",6"Mentioned current contract ends next month",7"Requested a technical demo for their team"8],9"concerns": [10"Needs approval from IT security team",11"Integration with existing CRM"12],13"decisionMakerInvolved": true,14"estimatedTimeline": "30-45 days",15"recommendedFollowUp": "Schedule technical demo within 1 week, prepare security documentation",16"nextSteps": [17"Send security compliance documentation",18"Schedule demo with technical team",19"Prepare CRM integration case study"20]21}
Generates structured conversation summaries in a custom format designed for your specific workflow. This example uses the BANT framework for sales conversations.
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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function createOperator() {14const operator = await client.intelligence.v3.operators.create({15displayName: "Tailored Summaries",16description:17"Generates structured conversation summaries in a custom format designed for specific workflows.",18prompt:19"Summarize this sales conversation using the BANT framework:\n\n- Budget: Does the customer have a budget allocated? What is it?\n- Authority: Is this person the decision-maker? Who else is involved?\n- Need: What problem is the customer trying to solve?\n- Timeline: When does the customer need a solution in place?\n\nProvide clear, actionable insights for each category.",20outputFormat: "JSON",21outputSchema: {22type: "object",23properties: {24budget: {25type: "object",26properties: {27identified: {28type: "boolean",29},30amount: {31type: "string",32},33notes: {34type: "string",35},36},37},38authority: {39type: "object",40properties: {41isDecisionMaker: {42type: "boolean",43},44role: {45type: "string",46},47otherStakeholders: {48type: "string",49},50},51},52need: {53type: "object",54properties: {55primaryProblem: {56type: "string",57},58painPoints: {59type: "array",60items: {61type: "string",62},63},64desiredOutcome: {65type: "string",66},67},68},69timeline: {70type: "object",71properties: {72urgency: {73type: "string",74enum: [75"immediate",76"short_term",77"medium_term",78"long_term",79"unknown",80],81},82targetDate: {83type: "string",84},85drivingEvent: {86type: "string",87},88},89},90overallAssessment: {91type: "string",92},93},94},95});9697console.log(operator.id);98}99100createOperator();
The following response example shows the result property of the OperatorResult. To view the full response structure, see the Upsell Opportunity Detection example.
1{2"budget": {3"identified": true,4"amount": "$50,000-75,000 annually",5"notes": "Budget approved for this fiscal year, but needs to be spent by Q4"6},7"authority": {8"isDecisionMaker": false,9"role": "Director of Operations",10"otherStakeholders": "VP of Technology has final sign-off, Procurement involved for contracts over $50k"11},12"need": {13"primaryProblem": "Current system cannot handle increased call volume after expansion",14"painPoints": [15"Dropped calls during peak hours",16"No visibility into agent performance",17"Manual reporting taking 10+ hours per week"18],19"desiredOutcome": "Scalable solution with real-time analytics and automated reporting"20},21"timeline": {22"urgency": "short_term",23"targetDate": "End of Q3",24"drivingEvent": "New product launch expected to double inbound call volume"25},26"overallAssessment": "Strong fit with clear need and budget. Focus on building relationship with VP of Technology and addressing scalability requirements in proposal."27}
Extracts commitments, next steps, and follow-up tasks from completed conversations. Use to automate task creation and ensure nothing falls through the cracks.
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 at twilio.com/console5// Provision API Keys at twilio.com/console/runtime/api-keys6// and set the environment variables. See http://twil.io/secure7// For local testing, you can use your Account SID and Auth token8const accountSid = process.env.TWILIO_ACCOUNT_SID;9const apiKey = process.env.TWILIO_API_KEY;10const apiSecret = process.env.TWILIO_API_SECRET;11const client = twilio(apiKey, apiSecret, { accountSid: accountSid });1213async function createOperator() {14const operator = await client.intelligence.v3.operators.create({15displayName: "Follow-up Action Items",16description:17"Extracts action items, commitments, and follow-up tasks from completed conversations.",18prompt:19"Review this conversation and extract all action items, commitments, and follow-up tasks. For each item, identify who is responsible (agent or customer), what needs to be done, and any mentioned deadlines or timeframes. Prioritize items by urgency.",20outputFormat: "JSON",21outputSchema: {22type: "object",23properties: {24actionItems: {25type: "array",26items: {27type: "object",28properties: {29task: {30type: "string",31},32owner: {33type: "string",34enum: ["agent", "customer", "other"],35},36deadline: {37type: "string",38},39priority: {40type: "string",41enum: ["high", "medium", "low"],42},43context: {44type: "string",45},46},47},48},49agentCommitments: {50type: "array",51items: {52type: "string",53},54},55customerCommitments: {56type: "array",57items: {58type: "string",59},60},61followUpRequired: {62type: "boolean",63},64suggestedFollowUpDate: {65type: "string",66},67},68},69});7071console.log(operator.id);72}7374createOperator();
The following response example shows the result property of the OperatorResult. To view the full response structure, see the Upsell Opportunity Detection example.
1{2"actionItems": [3{4"task": "Send updated contract with revised pricing",5"owner": "agent",6"deadline": "End of day today",7"priority": "high",8"context": "Customer requested 15% volume discount reflected in writing"9},10{11"task": "Schedule technical demo with IT team",12"owner": "agent",13"deadline": "This week",14"priority": "high",15"context": "Customer wants to include their CTO and two engineers"16},17{18"task": "Provide list of current integrations",19"owner": "customer",20"deadline": "Before demo",21"priority": "medium",22"context": "Needed to prepare customized demo environment"23}24],25"agentCommitments": [26"Send revised contract by end of day",27"Schedule demo for this week",28"Include case study from similar-sized company"29],30"customerCommitments": [31"Send list of current integrations",32"Confirm demo attendees by Wednesday"33],34"followUpRequired": true,35"suggestedFollowUpDate": "3 days from now if contract not signed"36}
After creating a custom language operator:
- Add the operator to an intelligence configuration rule to start analyzing conversations
- Review the Rule Execution webhook payload to understand the
OperatorResultdata you'll receive when consuming Rule Executions.