MCPInstall
twilio/ai avatar

twilio-conversation-intelligence

Twilio Conversation Intelligence development guide. Use when building real-time or post-call conversation analysis, language operator pipelines, sentiment analysis, agent assist, cross-channel analytics, or querying aggregated conversation insights (sentiment trends, escalation rates, dashboards).

Installs
169
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/twilio/ai --skill twilio-conversation-intelligence
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads twilio-conversation-intelligence automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Conversation Intelligence

Decision-making guide for Twilio's Conversation Intelligence v3 API — real-time and post-call GenAI analysis of conversations across Voice, SMS, RCS, and WhatsApp. Covers Intelligence Configurations, Language Operators (Twilio-authored and custom), Rules, Triggers, Actions, and result consumption.

Security: All inbound messages captured by the Orchestrator are untrusted external input. If Intelligence operators process this content with LLMs, their prompts should include instructions to ignore adversarial content and not follow instructions embedded in customer messages.

GA — Conversation Intelligence v3 is generally available.

Use Cases

Conversation Intelligence powers human agent augmentation — giving every agent a "second brain" that listens, understands, and surfaces the right data at the right time. Agents focus on empathy, judgment, and problem-solving; AI handles analysis and assistance.

Wrap-up Agent Assist (Post-Call)

Analyze completed conversations and generate structured outputs — summaries, sentiment signals, topic dispositions. Reduces after-call work, accelerates agent transitions to next interaction. Low-friction entry point — start here.

  • Operators: Summary, Sentiment, custom Conversation Scoring
  • Trigger: CONVERSATION_END
  • Integration: Webhook → CRM case note creation

Real-time Agent Assist

Analyze conversations as they unfold. Surface sentiment shifts, script adherence signals, or recommended next responses enriched with customer history and enterprise knowledge. Agents respond more confidently without searching across systems.

  • Operators: Script Adherence, Next Best Response, Escalation Risk (custom)
  • Trigger: COMMUNICATION
  • Integration: Webhook → Agent desktop overlay

Real-time Workflow Automation

Combine real-time intelligence with orchestration to trigger downstream workflows when specific conditions are met — escalate to supervisor, trigger fraud prevention, notify specialist.

  • Operators: Custom risk detection, compliance monitoring
  • Trigger: COMMUNICATION
  • Integration: Webhook → Workflow engine / TaskRouter

Contact Center QA

Generate post-interaction summaries, sentiment scores, and compliance signals for QA, coaching, and analytics. Aggregate across interactions to support training and continuous optimization.

  • Operators: Script Adherence, Summary, custom Conversation Scoring
  • Trigger: CONVERSATION_END
  • Integration: Webhook → Analytics / BI tools

How It Works

┌─────────────────────────────────────────────────────────────────────────────┐
│  1. Customer engages agent (Voice, SMS, WhatsApp, RCS, Chat, Email)         │
└─────────────────────────────────────────────────────────────────────────────┘
                                      │
                                      ▼
┌─────────────────────────────────────────────────────────────────────────────┐
│  2. Conversations (Conversation Orchestrator) groups communications into a  │
│     Conversation                                                            │
│     - Normalizes channel events                                             │
│     - Groups related messages/utterances                                    │
│     - Tracks participants (CUSTOMER, HUMAN_AGENT, AI_AGENT)                 │
└─────────────────────────────────────────────────────────────────────────────┘
                                      │
                                      ▼
┌─────────────────────────────────────────────────────────────────────────────┐
│  3. Conversation events trigger Intelligence rules                          │
│     - COMMUNICATION: on each new message/utterance                          │
│     - CONVERSATION_END: when conversation closes                            │
│     - CONVERSATION_INACTIVE: when conversation goes idle                    │
└─────────────────────────────────────────────────────────────────────────────┘
                                      │
                                      ▼
┌─────────────────────────────────────────────────────────────────────────────┐
│  4. Language Operators analyze the conversation                             │
│     - Twilio-authored: Sentiment, Summary, NBR, Script Adherence            │
│     - Custom: domain-specific analysis with your prompts                    │
│     - Context: enriched with Customer Memory + Enterprise Knowledge         │
└─────────────────────────────────────────────────────────────────────────────┘
                                      │
                                      ▼
┌─────────────────────────────────────────────────────────────────────────────┐
│  5. Results delivered via webhook + REST API                                │
│     - Real-time: Agent desktop, workflow triggers                           │
│     - Post-call: CRM notes, QA systems, analytics                           │
│     - Aggregated: Conversational Insights for cross-conversation analysis   │
└─────────────────────────────────────────────────────────────────────────────┘

Key insight: Real-time and post-conversation intelligence use the same underlying model. Start with low-friction post-call summaries, then progressively introduce real-time assist using the same components.

Scope

CAN

  • Analyze conversations in real-time (per-message) and post-conversation (at close/inactive) via Language Operators
  • Use 4 Twilio-authored operators: Sentiment, Summary, Next Best Response, Script Adherence
  • Create custom Language Operators with natural language prompts and structured output (TEXT, JSON, CLASSIFICATION) — EXTRACTION is a read-only format returned by some Twilio-authored operators; it cannot be set on custom operators you create
  • Define up to 5 rules per Intelligence Configuration, each with 1-5 operators (minimum 1 required), 0 or 1 trigger, and 0-2 webhook actions
  • Throttle real-time triggers with count parameter (run every N communications, min 1, max 20)
  • Deliver results via webhook (POST) and query historically via REST API
  • Track conversations across SMS, Voice, RCS, WhatsApp, Chat, and Email channels via Conversation Orchestrator (Conversations v2) integration
  • Create custom operators with parameters ({{parameters.name}} syntax), including knowledge base references (KNOWLEDGE_BASE_AND_SOURCE_IDS type — value format: knowledge_base_id:knowledge_source_id)
  • Enrich operators with Customer Memory (context.memory.enabled: true) and Enterprise Knowledge (context.knowledge.bases: [...]) at the rule or operator level
  • Add trainingExamples (input/output pairs) to custom operators to improve accuracy
  • Pin a specific operator version in a rule via operators[].version; omit to use latest
  • Query OperatorResults filtered by intelligenceConfigurationId, conversationId, or operatorId
  • Query operator versions and fetch specific version details
  • Delete Intelligence Configurations, custom Operators, and individual OperatorResults via REST API
  • Use ETag/If-Match headers for optimistic locking on Operator updates (returns 412 on mismatch) — ETag is not supported on Configuration updates
  • Filter Conversations by status, channels, createdAtBefore/createdAtAfter, channelId, intelligenceConfigurationIds, operatorIds
  • Authenticate with both Account SID/Auth Token and API Key/Secret
  • Define rules without a trigger (trigger is optional per spec; runs on all events if omitted)

CANNOT

  • JSON-only API — All v3 endpoints require Content-Type: application/json. Form-encoded bodies return HTTP 415 with error 20422.
  • No standalone operation — v3 requires Conversation Orchestrator (Conversations v2) for conversation capture. You cannot feed raw messages or recordings into v3 directly.
  • No per-message sentiment — Sentiment is conversation-level, accumulating across all messages. A conversation with one positive and one negative message returns "mixed", not separate results per message.
  • No deleting Twilio-authored operators — DELETE returns 404 "Operator not found" for Twilio-authored operators, not 403. They are not treated as "yours" to delete.
  • No editing Twilio-authored operator prompts — Twilio-authored operators have prompt: null when retrieved via GET. The prompt is hidden and not configurable.
  • No more than 2 actions per rule — The API enforces size must be between 0 and 2 for actions.
  • No more than 5 rules per configuration — API enforces size must be between 0 and 5.
  • No PCI or HIPAA compliance — Conversation Intelligence v3 is not PCI compliant or HIPAA Eligible. Do not use for payment data or protected health information.
  • No GET/PUT/DELETE on v3 Conversations — The Conversations endpoint is read-only (GET list, GET by ID). Conversation lifecycle is controlled by Conversation Orchestrator, not by the Intelligence API.
  • No unsupported JSON schema features — The following are rejected in outputSchema: minLength/maxLength (strings), patternProperties (objects), uniqueItems (arrays). Use basic types only.
  • Cannot use PUT to update a live configuration — PUT creates an inactive version with no activation API. Operators silently stop returning results. Workaround: DELETE the configuration and POST to recreate it.
  • Silent Memory Store linkage failures — If memoryStoreId points to a deleted or invalid store, capture still works but identity resolution and extraction silently fail with no error. Implement periodic health checks to verify Memory Store linkage is functioning.

Quick Decision

NeedUseWhy
Real-time agent assist during live calls/chatsv3 + COMMUNICATION trigger + Next Best Response operatorReal-time webhook delivery per utterance
Post-call QA scoringv3 + CONVERSATION_END trigger + Script Adherence operatorRuns once at conversation close, returns detailed score
Conversation sentiment trackingv3 + Sentiment operator (Twilio-authored)Conversation-level classification: positive/negative/neutral/mixed
Post-call recording transcription + analysisv2 Voice Intelligence (existing)v3 does not ingest recordings directly — v2 pipeline handles recording→transcript→operators
Custom domain-specific analysisv3 + Custom operator with JSON outputDefine prompt, parameters, structured output schema
Cross-channel conversation historyConversations v2 (Conversation Orchestrator) alonev3 adds analysis on top; Conversation Orchestrator handles capture and history
Simple keyword extractionv3 + Custom operator (EXTRACTION format)Structured extraction with custom prompt

Decision Frameworks

v2 (Voice Intelligence) vs v3 (Conversation Intelligence)

Dimensionv2 (Voice Intelligence)v3 (Conversation Intelligence)
Input sourceRecording SIDs (audio)Conversation Orchestrator conversations (text/transcriptions)
ChannelsVoice onlySMS, Voice, RCS, WhatsApp, Chat, Email
Operator managementConsole only (attach to Intelligence Service)REST API (full CRUD on custom operators)
Trigger modelPost-transcription (async)Real-time (per-message) or post-conversation
Result deliveryWebhook (voice_intelligence_transcript_available)Webhook (per-rule action) + REST query
SDK supportclient.intelligence.v2.transcriptsTwilio Node.js SDK supported
SID prefixGA (service), GT (transcript), LY (operator)intelligence_configuration_*, intelligence_operator_*
StatusGAGA
CoexistenceWorks alongside v3Works alongside v2

Use v2 when: You need post-call transcription from recordings, or need GA stability. Use v3 when: You need real-time analysis, cross-channel support, or API-managed custom operators.

Real-Time vs Post-Conversation

FactorCOMMUNICATION triggerCONVERSATION_END triggerCONVERSATION_INACTIVE trigger
When it firesOn each new message/utteranceWhen conversation closesWhen conversation goes idle
LatencyNear real-timeSeconds after closeAfter inactive timeout
Use casesAgent assist, escalation detection, live complianceQA scoring, summaries, CRM updatesIdle conversation follow-up
Operator contextAccumulating — sees all messages so farComplete conversationMessages up to inactivity point
Throttlingcount parameter (every N messages)N/AN/A
Cost implicationRuns per message (more executions)Runs once per conversationRuns once per inactivity event

Operator Version Lifecycle

StatusBehaviorWhen
PREVIEWNormal execution, restricted visibilityInternal/testing versions
ACTIVENormal execution, full availabilityProduction-ready versions
DEPRECATEDExecutes with Warn event via WatchMigration window — update to newer version
RETIREDHard failure, Error logged in WatchMust update Intelligence Configuration manually

Custom Operator Output Formats

FormatUse WhenResult ShapeSchema Support
TEXTFree-form analysis, summaries, translations{"text": "..."}Auto-generated (not customizable)
JSONStructured extraction with custom fieldsUser-defined via outputSchemaFull JSON Schema (max 100 props, 10 nesting levels, 1000 enum values max)
CLASSIFICATIONCategory labeling (sentiment, intent, topic){"label": "..."}Auto-generated
EXTRACTIONReturned by some Twilio-authored operators only — cannot be set on custom operators{"entities": [{"text": "...", "label": "..."}]}N/A (read-only)

Twilio-Authored Operator Reference

Ready-to-use operators maintained by Twilio. Use these IDs directly in rules — no custom prompt required.

OperatorIDBest TriggerUse Case
Sentimentintelligence_operator_01kcrvw16kfa88qvgrfmr7y151COMMUNICATIONReal-time sentiment tracking (positive/negative/neutral/mixed)
Summaryintelligence_operator_01kcv35pnkeysaf6z6cqtbpegnCONVERSATION_ENDPost-call conversation summary
Next Best Responseintelligence_operator_01kea27sy7ffsafmtsfp17nzx4COMMUNICATIONReal-time agent assist with suggested responses
Script Adherenceintelligence_operator_01kf34tcyefpyb1t4m0nbd8rxgCONVERSATION_ENDQA scoring for script compliance

Note: Twilio-authored operators have author: "TWILIO" and prompt: null when retrieved via GET. Prompts are hidden and not configurable. Use custom operators if you need control over the prompt.

Integration Patterns

Code samples use raw fetch() for clarity, but the Twilio Node.js SDK is also supported for v3.

Authentication Helper

const INTELLIGENCE_V3_BASE = 'https://intelligence.twilio.com/v3';

function getAuthHeaders() {
  const credentials = Buffer.from(
    `${process.env.TWILIO_ACCOUNT_SID}:${process.env.TWILIO_AUTH_TOKEN}`
  ).toString('base64');
  return {
    'Authorization': `Basic ${credentials}`,
    'Content-Type': 'application/json',
  };
}

Create Intelligence Configuration with Rules

// Step 1: Create configuration (empty rules initially)
const configResponse = await fetch(
  `${INTELLIGENCE_V3_BASE}/ControlPlane/Configurations`,
  {
    method: 'POST',
    headers: getAuthHeaders(),
    body: JSON.stringify({
      displayName: 'Customer Support Analytics',
      description: 'Real-time sentiment + post-call summary',
      rules: [],
    }),
  }
);
const config = await configResponse.json();
// config.id = "intelligence_configuration_..."

// Step 2: Add rules via PUT (replaces all rules)
const updateResponse = await fetch(
  `${INTELLIGENCE_V3_BASE}/ControlPlane/Configurations/${config.id}`,
  {
    method: 'PUT',
    headers: getAuthHeaders(),
    body: JSON.stringify({
      displayName: 'Customer Support Analytics',
      rules: [
        {
          operators: [
            { id: 'intelligence_operator_01kcrvw16kfa88qvgrfmr7y151' }, // Sentiment
          ],
          triggers: [{ on: 'COMMUNICATION' }],
          actions: [
            { type: 'WEBHOOK', method: 'POST', url: 'https://your-app.com/realtime-results' },
          ],
        },
        {
          operators: [
            { id: 'intelligence_operator_01kcv35pnkeysaf6z6cqtbpegn' }, // Summary
          ],
          triggers: [{ on: 'CONVERSATION_END' }],
          actions: [
            { type: 'WEBHOOK', method: 'POST', url: 'https://your-app.com/post-call-results' },
          ],
        },
      ],
    }),
  }
);
const updatedConfig = await updateResponse.json();
// updatedConfig.version = 2 (auto-incremented)

Link to Conversation Orchestrator Conversation Configuration

// Intelligence config must be linked to a Conversation Orchestrator conversation config
// See conversation-orchestrator skill for full Conversation Orchestrator setup
const convConfigResponse = await fetch(
  'https://conversations.twilio.com/v2/ControlPlane/Configurations',
  {
    method: 'POST',
    headers: getAuthHeaders(),
    body: JSON.stringify({
      displayName: 'Support Config',
      memoryStoreId: 'mem_store_...',  // Required — create via Memory API first
      conversationGroupingType: 'GROUP_BY_PARTICIPANT_ADDRESSES',
      intelligenceConfigurationIds: [config.id],
      channelSettings: {
        SMS: {
          statusTimeouts: { inactive: 5, closed: 10 },
          captureRules: [{ from: '*', to: '+1XXXXXXXXXX', metadata: {} }],
        },
      },
    }),
  }
);

Consume Operator Results

// Query all results for an intelligence configuration
const resultsResponse = await fetch(
  `${INTELLIGENCE_V3_BASE}/OperatorResults?intelligenceConfigurationId=${config.id}`,
  { headers: getAuthHeaders() }
);
const results = await resultsResponse.json();

for (const operatorResult of results.items) {
  console.log(`Operator: ${operatorResult.operator.id}`);
  console.log(`Format: ${operatorResult.outputFormat}`);
  console.log(`Payload: ${JSON.stringify(operatorResult.result)}`); // e.g. { text: "..." } or { label: "..." }
  console.log(`Conversation: ${operatorResult.conversationId}`);
  console.log(`Trigger: ${operatorResult.executionDetails.trigger.on}`);
  // Context that was actually used at runtime (single source of truth):
  console.log(`Memory profile: ${operatorResult.executionDetails.resolvedContext?.memory?.profileId}`);
  console.log(`Knowledge sources: ${JSON.stringify(operatorResult.executionDetails.resolvedContext?.knowledge?.sources)}`);
  // Cost/perf metadata:
  console.log(`Model: ${operatorResult.metadata.system.resolvedModel}, latencyMs: ${operatorResult.metadata.system.latencyMs}`);
}

Paginate Through Results

All list endpoints (/OperatorResults, /Conversations, /Operators, /Configurations) use cursor-based pagination. Default page size is 50; maximum is 1000.

async function* getAllOperatorResults(configId) {
  let pageToken = undefined;
  do {
    const url = new URL(`${INTELLIGENCE_V3_BASE}/OperatorResults`);
    url.searchParams.set('intelligenceConfigurationId', configId);
    url.searchParams.set('pageSize', '1000');
    if (pageToken) url.searchParams.set('pageToken', pageToken);

    const response = await fetch(url, { headers: getAuthHeaders() });
    const data = await response.json();

    yield* data.items;
    pageToken = data.meta?.nextToken; // null/undefined when no more pages
  } while (pageToken);
}

// Usage:
for await (const result of getAllOperatorResults(config.id)) {
  console.log(result.operator.id, result.result);
}

Enable Customer Memory and Enterprise Knowledge on a Rule

// Context is configured at the rule level (not the operator level)
rules: [
  {
    operators: [{ id: 'intelligence_operator_01kea27sy7ffsafmtsfp17nzx4' }], // NBR
    triggers: [{ on: 'COMMUNICATION' }],
    actions: [{ type: 'WEBHOOK', method: 'POST', url: 'https://your-app.com/nbr' }],
    context: {
      memory: { enabled: true },          // inject customer profile from Memory Store
      knowledge: {
        bases: ['knowledge_base_id_here'], // inject enterprise KB articles
      },
    },
  },
]

Create a Custom Operator with Training Examples and Parameters

const operatorResponse = await fetch(
  `${INTELLIGENCE_V3_BASE}/ControlPlane/Operators`,
  {
    method: 'POST',
    headers: getAuthHeaders(),
    body: JSON.stringify({
      displayName: 'Escalation Risk Detector',
      prompt: `Analyze this conversation between a customer and agent.
Product context: {{parameters.productName}}
Classify escalation risk as LOW, MEDIUM, or HIGH based on customer frustration signals.`,
      outputFormat: 'CLASSIFICATION',
      parameters: {
        productName: { type: 'STRING', required: true, description: 'Product line being discussed' },
        // KNOWLEDGE_BASE_AND_SOURCE_IDS parameters are passed as "kb_id:source_id" at rule time
        knowledgeContext: { type: 'KNOWLEDGE_BASE_AND_SOURCE_IDS', required: false },
      },
      trainingExamples: [
        {
          input: 'Customer: This is the third time I have called about this issue',
          output: 'HIGH',
        },
        {
          input: 'Customer: Thanks, I think that might work',
          output: 'LOW',
        },
      ],
    }),
  }
);
const operator = await operatorResponse.json();
// Pin this operator to a specific version in your rule:
// operators: [{ id: operator.id, version: operator.version }]

Gotchas

Setup

  1. Memory Store is required for Conversation Orchestrator: You cannot create a Conversations v2 Configuration without a memoryStoreId. The Memory API returns "memoryStoreId: must not be null" (error 20001). Create the Memory Store first via POST memory.twilio.com/v1/ControlPlane/Stores.

  2. JSON-only API: All v3 endpoints require Content-Type: application/json. Form-encoded bodies return HTTP 415 with error 20422 ("does not support this payload format"). This matches Conversation Orchestrator but differs from most Twilio APIs.

  3. v2 and v3 coexist independently: Creating v3 configurations does not affect v2 Intelligence Services (GA* SIDs). Both are accessible on the same account simultaneously. They share the intelligence.twilio.com host but use different URL paths (/v2/Services vs /v3/ControlPlane/Configurations).

Configuration

  1. PUT creates an inactive version — operators stop returning results: When you PUT to update an Intelligence Configuration, the new version is created in an inactive state. There is no activation API to make it live. Your operators will silently stop producing results. Workaround: DELETE the configuration and POST to recreate it with the updated rules/operators. This is the only reliable way to update a live configuration.

  2. PUT replaces all rules: Updating a configuration replaces the entire rules array. There is no PATCH or per-rule update. Always include all rules in the PUT body, not just the changed one.

  3. Config version auto-increments: Each PUT bumps the version field. Conversation Orchestrator conversation configs use version for optimistic locking, but Intelligence configs accept PUT without version checks.

  4. Rules get their own IDs: When rules are created via PUT, each gets an auto-generated ID (intelligence_configurationrule_*). These IDs appear in OperatorResult references but are not user-settable.

  5. Trigger count parameter throttles execution: Setting {"on":"COMMUNICATION","parameters":{"count":3}} runs the operator every 3 messages instead of every message.

Runtime

  1. Dual capture rules cause duplicate processing: If both inbound (from: *, to: +1XXX) and outbound (from: +1XXX, to: *) capture rules match the same SMS, Conversation Orchestrator creates two Communications for one message, and Intelligence produces two OperatorResults. Use unidirectional capture rules unless you specifically want both.

  2. Twilio number is auto-typed HUMAN_AGENT: In Conversation Orchestrator conversations, the Twilio number is automatically assigned type: "HUMAN_AGENT" and the external number gets type: "CUSTOMER" with automatic memory profile resolution (mem_profile_*).

  3. Sentiment accumulates across messages: The Sentiment operator analyzes the full conversation context, not individual messages. After a positive message, sentiment was "positive". After adding a negative message to the same conversation, it became "mixed".

  4. Near real-time delivery for COMMUNICATION trigger: Results are delivered via webhook shortly after each utterance — the full pipeline is Conversation Orchestrator capture → Intelligence trigger → Operator execution → webhook delivery.

  5. Custom operator TEXT output auto-wraps: Custom operators with outputFormat: "TEXT" always return {"text": "..."} regardless of the prompt. The outputSchema is auto-generated and not customizable for TEXT format.

Observability

  1. conversationConfigurationId returns "unused": The v3 Conversations endpoint returns "conversationConfigurationId": "unused" instead of the actual Conversation Orchestrator config ID. Use intelligenceConfigurationIds array instead for linking.

  2. No isTwilioAuthored field: Twilio-authored operators are distinguished by author: "TWILIO", custom operators by author: "SELF". There is no boolean isTwilioAuthored field.

  3. Twilio-authored operator prompts are hidden: GET on a Twilio-authored operator returns prompt: null. You cannot inspect or modify the system prompt. Custom operators return the full prompt.

  4. Two separate metadata sections: OperatorResults carry both metadata.system and executionDetails.resolvedContext — they serve different purposes:

  • metadata.system: cost and performance — resolvedModel (LLM used), latencyMs, inputCharacters/outputCharacters (billing units), inputTruncated
  • executionDetails.resolvedContext: what context was actually injected at runtime — memory (profileId, memoryStoreId) and knowledge (sources: array of {baseId, sourceId}). This is the single source of truth for context resolution.

Error Handling

  1. Error codes are consistent: v3 uses Twilio standard error codes: 20001 (bad request/validation), 20404 (not found), 20422 (unsupported format), 70001 (operator validation). All include userError: true and descriptive messages.

  2. Invalid operator ID gives specific error: Using a non-existent operator ID in a rule returns 400 with code 70001 and message identifying the exact invalid operator.

JSON Schema

  1. All JSON schema fields are required by default — and Twilio auto-sets this: Twilio automatically sets additionalProperties: false and marks all provided fields as required in outputSchema. Do not add required or additionalProperties yourself — Twilio overwrites any values you provide. The practical consequence: if the LLM cannot populate a field, the operator execution fails. Use union types for nullable fields: "type": ["string", "null"].

  2. Nullable field pattern: To make a field optional/nullable in JSON output, use array type union:

{
  "outputSchema": {
    "type": "object",
    "properties": {
      "requiredField": { "type": "string" },
      "optionalField": { "type": ["string", "null"] }
    }
  }
}

This allows the operator to return null for fields where the LLM has insufficient context.

  1. Unsupported JSON schema features cause silent or hard failures: The following JSON Schema features are NOT supported in outputSchema and will be rejected. Stick to type, enum, properties, items, anyOf, $defs/$ref.
  • Strings: minLength, maxLength
  • Objects: patternProperties, unevaluatedProperties, propertyNames, minProperties, maxProperties
  • Arrays: unevaluatedItems, contains, minContains, maxContains, uniqueItems
  1. executionDetails.context was removed: Older docs and some live responses may show executionDetails.context. This field was removed in a breaking change. Use executionDetails.resolvedContext — it contains memory (profileId, memoryStoreId) and knowledge (array of baseId/sourceId pairs).

  2. Operator result query param is intelligenceConfigurationId (not intelligenceConfiguration): The REST API filter parameter for listing OperatorResults by config is intelligenceConfigurationId. Using the shorter form returns unfiltered results.

  3. KNOWLEDGE_BASE_AND_SOURCE_IDS parameter values must use colon-separated format: When passing a knowledge base parameter to an operator at rule time, the value must be formatted as "knowledge_base_id:knowledge_source_id". Passing just the KB ID or using any other separator returns a validation error. Only plaintext KB sources are supported.

  4. KNOWLEDGE_BASE_AND_SOURCE_IDS parameters do not support default: Unlike STRING, INTEGER, NUMBER, and BOOLEAN parameter types which all allow a default value, KNOWLEDGE_BASE_AND_SOURCE_IDS does not. Defining a default on a KB parameter will be ignored or rejected.

  5. Each rule requires at least 1 operator: The operators array on a rule has minItems: 1. Submitting a rule with an empty operators array on create or update returns a 400 validation error.

  6. List endpoints are paginated — don't assume you got all results: All list endpoints (/OperatorResults, /Conversations, /Operators, /Configurations) return a max of 50 items by default (max 1000 with pageSize). The response meta.nextToken is non-null when more pages exist. Always paginate when querying production data sets.

Conversational Insights (Cross-Conversation Analytics)

Where the Intelligence API gives you per-conversation OperatorResults, the Insights API v3 is the query layer for aggregating across thousands of conversations — grouping, filtering, and counting by dimensions like sentiment, channel, language, and operator output.

Base URL: https://insights.twilio.com

Public Beta — Insights v3 is currently in public beta. The query schema is subject to change.

When to Use Insights vs Intelligence REST API

GoalUse
Get the result for a specific conversationIntelligence API: GET /v3/OperatorResults?conversationId=...
Count conversations by sentiment over timeInsights API: query with OperatorResult.Value dimension
Find all conversations where agent went off-scriptInsights API: filter on OperatorResult.Value
Build a sentiment trend dashboardInsights API: group by DateCreated + OperatorResults
Discover available metrics and dimensionsInsights API: GET /v3/InsightsDomains/Conversations/Metadata

Endpoints

MethodPathPurpose
POST/v3/InsightsDomains/Conversations/QueryExecute a semantic query, returns first page
GET/v3/InsightsDomains/Conversations/Query?pageToken=...Fetch subsequent pages
GET/v3/InsightsDomains/Conversations/MetadataDiscover available cubes, measures, dimensions

Same Basic Auth as Intelligence API. JSON-only (Content-Type: application/json).

Query a Sentiment Distribution

const INSIGHTS_BASE = 'https://insights.twilio.com';

const response = await fetch(
  `${INSIGHTS_BASE}/v3/InsightsDomains/Conversations/Query`,
  {
    method: 'POST',
    headers: getAuthHeaders(), // same helper as Intelligence API
    body: JSON.stringify({
      domain: 'Conversations',
      query: {
        measures: ['Conversation.Count'],
        dimensions: ['OperatorResults', 'Channels', 'DateCreated'],
        filters: [{
          op: 'AND',
          expressions: [
            { op: 'IN', field: 'OperatorResult.Value', values: ['positive', 'negative'] },
          ],
        }],
        orderBy: [{ field: 'OperatorResults.CreatedDate', direction: 'DESC' }],
      },
    }),
  }
);
const data = await response.json();
// data.items = [{ Id: 'conv1', OperatorResults: 'positive', Channels: ['voice'], ... }]
// data.meta.nextToken — use for next page (null if last page)

Query fields:

FieldDescription
query.measuresWhat to aggregate — e.g. "Conversation.Count", "OperatorResult.Count"
query.dimensionsWhat to group by — e.g. "OperatorResults", "Channels", "Languages", "DateCreated"
query.filtersNested filter tree with op + expressions. Filter ops: AND, OR, EQ, NE, GT, LT, IN
query.orderBySort by field + ASC/DESC

Pagination

POST returns the first page. Subsequent pages use GET with pageToken. Stop when meta.nextToken is null.

async function* queryAll(queryBody) {
  const first = await fetch(`${INSIGHTS_BASE}/v3/InsightsDomains/Conversations/Query`,
    { method: 'POST', headers: getAuthHeaders(), body: JSON.stringify(queryBody) }
  ).then(r => r.json());
  yield* first.items;

  let nextToken = first.meta?.nextToken;
  while (nextToken) {
    const page = await fetch(
      `${INSIGHTS_BASE}/v3/InsightsDomains/Conversations/Query?pageToken=${nextToken}`,
      { headers: getAuthHeaders() }
    ).then(r => r.json());
    yield* page.items;
    nextToken = page.meta?.nextToken;
  }
}

Discover Available Dimensions and Measures

const meta = await fetch(
  `${INSIGHTS_BASE}/v3/InsightsDomains/Conversations/Metadata`,
  { headers: getAuthHeaders() }
).then(r => r.json());

for (const cube of meta.cubes) {
  console.log('Measures:', cube.measures.map(m => m.name));
  console.log('Dimensions:', cube.dimensions.map(d => d.name));
}

Known dimensions: DateCreated, OperatorResults, OperatorResult.Value, Channels, Languages, Conversation.AccountSid

Known measures: Conversation.Count, OperatorResult.Count

Insights CANNOT

  • Return raw OperatorResult payloads — use Intelligence GET /v3/OperatorResults for that
  • Write anything — read-only
  • Query in real-time — data mart has indexing lag vs. the live Intelligence API
  • Query domains other than Conversations

Related Resources

  • Conversation Orchestrator Skill — Conversation Orchestrator setup: Memory Store, Conversation Configuration, capture rules, participant types
  • Twilio Conversations (unified stack) — End-to-end integration guide for Conversation Orchestrator + Conversation Memory + Intelligence v3 pipeline

FAQ

What does the twilio-conversation-intelligence skill do?

Twilio Conversation Intelligence development guide. Use when building real-time or post-call conversation analysis, language operator pipelines, sentiment analysis, agent assist, cross-channel analytics, or querying aggregated conversation insights (sentiment trends, escalation rates, dashboards).

How do I install twilio-conversation-intelligence?

Run npx skills add https://github.com/twilio/ai --skill twilio-conversation-intelligence in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/twilio-conversation-intelligence/ (personal) or .claude/skills/twilio-conversation-intelligence/ (project).

Which AI agents can use twilio-conversation-intelligence?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is twilio-conversation-intelligence safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains twilio-conversation-intelligence?

It is published by twilio/ai in twilio/ai. It has 169 recorded installs.

More from twilio/ai

View all →

SMS and MMS deep-dive reference. Covers SMS-specific error codes, message filtering troubleshooting ("Messages Being Filtered or Blocked?" diagnostic checklist), MMS media support (US/CA/AU only), and SMS pumping indicators. For sending SMS, use twilio-send-message instead. Use this skill only when debugging SMS delivery issues or needing SMS-specific details not in the consolidated send skill.

Send messages via Twilio's Programmable Messaging API across all channels — SMS, MMS, RCS, and WhatsApp. Covers text messages, media, rich content (cards, carousels, buttons), template-based sends, Messaging Services, status callbacks, and WhatsApp's 24-hour service window. Use when the user wants to send a message — whether they say "send SMS", "text message", "branded message", "rich message", "WhatsApp message", "RCS message", "notification", or "alert". For picking the right channel for a use case, first consult twilio-messaging-channel-advisor.

Backend & APIs800 installs

Send transactional and bulk email via the SendGrid v3 Mail Send API. Covers single sends, personalized batch sends with dynamic templates, scheduled sends with cancellation, attachments, and sandbox mode for testing. Use this skill when the caller has a SendGrid API key (SG.-prefix). Do NOT use this skill if the caller is using the Twilio Email API (comms.twilio.com) — that is a separate product with different credentials.

Design, secure, and operate Twilio webhook endpoints. Covers inbound event handling, status callbacks, signature validation, connection overrides for retry and timeout tuning, local development tunneling, and production hardening. Use this skill whenever an agent needs to receive HTTP callbacks from Twilio for any product -- messaging, voice, verify, or event streams.

Backend & APIs296 installs

Secure Twilio applications against common attacks. Covers credential management (API keys vs auth tokens), request validation (webhook signature verification), PCI DSS compliance, HIPAA account requirements, SMS pumping prevention, geo-permissions, and account isolation patterns. Use this skill when developers are building or deploying Twilio apps.

Security245 installs

Twilio Messaging channel overview and onboarding guide. Covers all channels (SMS, WhatsApp, RCS, Facebook Messenger), the unified Messages API, channel selection guidance, and the recommended setup sequence from first message to production monitoring. Start here before choosing a specific messaging channel.

Backend & APIs227 installs

Popular data & databases skills

View category →

Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.

OfficialData & Databases496.3K installs
prisma avatar

prisma-client-api

prisma/skills

Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".

OfficialData & Databases446.9K installs

Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.

OfficialData & Databases444.8K installs
prisma avatar

prisma-cli

prisma/skills

Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.

OfficialData & Databases443.7K installs
prisma avatar

prisma-postgres

prisma/skills

Deprecated compatibility name for prisma-postgres-setup. Use only when a user or existing integration explicitly invokes prisma-postgres; otherwise select prisma-postgres-setup.

OfficialData & Databases436.5K installs

Obtain or reuse a Prisma Postgres database and connect an application. Use when the user needs a database and has none configured ("I need a database", "add a Postgres database", "set up a database for this app"), runs or mentions create-db or npx create-db, or asks to set up or connect Prisma Postgres, including in v0 and the Vercel Marketplace. Hands Prisma ORM configuration to prisma-orm-setup; reuses an existing connection first and honors an explicit provider, driver, alternative ORM, or database-only choice.

OfficialData & Databases431.1K installs