# Integrate language operator results with your application

To build an end-to-end solution with Conversation Intelligence, integrate language operator results with your application. You can do this in either of the following ways:

* **Rule Execution webhook**: Receives language operator results as they're generated. Use for [real-time activation](/docs/conversations/intelligence/explore-language-operator-results#real-time-activation).
* **Intelligence API**: Retrieves historical language operator results and conversations processed by Intelligence. Use for [post-conversation activation](/docs/conversations/intelligence/explore-language-operator-results#post-conversation-activation).

## Rule Execution webhook

The Rule Execution webhook sends language operator results to your webhook endpoint as an HTTP `POST` request when they're generated. Use these results to inform your application's next steps, such as:

* Update agent UIs
* Trigger alerts or notifications
* Invoke downstream automation

To receive this webhook, you must [define a rule](/docs/conversations/intelligence/define-rules) with a valid action (`type: webhook`) in your intelligence configuration.

### Webhook payload

The webhook payload includes:

* A list of all language operator results generated by the rule execution
* Execution details, including:
  * The [trigger](/docs/conversations/intelligence/define-rules#triggers) that fired the rule
  * The resolved [context](/docs/conversations/intelligence/define-rules#context) (Conversation Memory and Enterprise Knowledge) used during execution
  * Communications range and participant information
* Execution metadata, including latency, model used, and input/output character counts
* Intelligence configuration and conversation identifiers

For more information about the webhook payload structure and properties, see [Rule Execution webhook](/docs/conversations/intelligence/webhooks/rule-execution#webhook-payload).

```json title="Example: Rule Execution webhook payload"
{
  "accountId": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "conversationId": "conv_conversation_772a49ae-48e7-4d18-9db5-a40f6203de01",
  "intelligenceConfiguration": {
    "id": "intelligence_configuration_0hcq1h4zbqcpr8ceyyk4cde7kr",
    "displayName": "Real-time Sentiment Analyzer",
    "version": 1,
    "ruleId": "intelligence_configurationrule_01kc6nrdc4f509sgccvd8hc27c"
  },
  "operatorResults": [
    {
      "id": "intelligence_operatorresult_01kc6nrdc4f9vrt6t2ypcy8b75",
      "operator": {
        "id": "intelligence_operator_01kcrvw16kfa88qvgrfmr7y151",
        "displayName": "Sentiment",
        "version": 2,
        "parameters": null
      },
      "outputFormat": "CLASSIFICATION",
      "result": {
        "label": "positive"
      },
      "dateCreated": "2026-03-11T12:33:36.143498Z",
      "referenceIds": [],
      "executionDetails": {
        "trigger": {
          "on": "COMMUNICATION",
          "timestamp": "2026-03-11T12:33:35.987654Z"
        },
        "communications": {
          "first": "conv_communication_00000000000000000000000000",
          "last": "conv_communication_00000000000000000000000001"
        },
        "channels": [
          "SMS"
        ],
        "participants": [
          {
            "id": "conv_participant_00000000000000000000000000",
            "profileId": "mem_profile_00000000000000000000000000",
            "type": "CUSTOMER"
          },
          {
            "id": "conv_participant_00000000000000000000000001",
            "profileId": null,
            "type": "HUMAN_AGENT"
          }
        ],
        "resolvedContext": {
          "memory": {
            "profileId": "mem_profile_00000000000000000000000000",
            "memoryStoreId": "mem_store_00000000000000000000000000"
          },
          "knowledge": {
            "sources": [
              {
                "baseId": "know_knowledgebase_00000000000000000000000000",
                "sourceId": "know_knowledge_00000000000000000000000000"
              }
            ]
          }
        }
      },
      "metadata": {
        "system": {
          "latencyMs": 1842,
          "resolvedModel": "gpt-5.4-mini",
          "inputCharacters": 3830,
          "outputCharacters": 150,
          "inputTruncated": false
        }
      }
    }
  ]
}
```

## Conversation Intelligence API

Use the [OperatorResults](/docs/api/intelligence/v3/OperatorResults) and [Conversations](/docs/api/intelligence/v3/Conversations) resources to retrieve historical language operator results and conversations processed by your intelligence configuration. You can use this data to:

* Analyze post-conversation results
* Report and audit
* Recover if a webhook delivery is missed

### OperatorResults resource

The [OperatorResults resource](/docs/api/intelligence/v3/OperatorResults) returns:

* The result of the language operator
* Rule execution metadata, including:
  * Parameter values
  * Context used
  * Rule and intelligence configuration IDs

You can filter results by:

* Intelligence configuration
* Conversation

The following is an example request and response using the OperatorResults resource:

Retrieve a list of language operator results

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID at twilio.com/console
// Provision API Keys at twilio.com/console/runtime/api-keys
// and set the environment variables. See http://twil.io/secure
// For local testing, you can use your Account SID and Auth token
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const apiKey = process.env.TWILIO_API_KEY;
const apiSecret = process.env.TWILIO_API_SECRET;
const client = twilio(apiKey, apiSecret, { accountSid: accountSid });

async function listOperatorResults() {
  const operatorResults = await client.intelligence.v3.operatorResults.list({
    limit: 20,
  });

  operatorResults.forEach((o) => console.log(o.outputFormat));
}

listOperatorResults();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID at twilio.com/console
# Provision API Keys at twilio.com/console/runtime/api-keys
# and set the environment variables. See http://twil.io/secure
# For local testing, you can use your Account SID and Auth token
api_key = os.environ["TWILIO_API_KEY"]
api_secret = os.environ["TWILIO_API_SECRET"]
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
client = Client(api_key, api_secret, account_sid)

operator_results = client.intelligence.v3.operator_results.list(limit=20)

for record in operator_results:
    print(record.output_format)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Intelligence.V3;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID at twilio.com/console
        // Provision API Keys at twilio.com/console/runtime/api-keys
        // and set the environment variables. See http://twil.io/secure
        // For local testing, you can use your Account SID and Auth token
        string apiKey = Environment.GetEnvironmentVariable("TWILIO_API_KEY");
        string apiSecret = Environment.GetEnvironmentVariable("TWILIO_API_SECRET");
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");

        TwilioClient.Init(apiKey, apiSecret, accountSid);

        var operatorResults = await OperatorResultResource.ReadAsync(limit: 20);

        foreach (var record in operatorResults) {
            Console.WriteLine(record.OutputFormat);
        }
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.intelligence.v3.OperatorResult;
import com.twilio.base.ResourceSet;

public class Example {
    // Find your Account SID at twilio.com/console
    // Provision API Keys at twilio.com/console/runtime/api-keys
    // and set the environment variables. See http://twil.io/secure
    // For local testing, you can use your Account SID and Auth token
    public static final String API_KEY = System.getenv("TWILIO_API_KEY");
    public static final String API_SECRET = System.getenv("TWILIO_API_SECRET");
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");

    public static void main(String[] args) {
        Twilio.init(API_KEY, API_SECRET, ACCOUNT_SID);
        ResourceSet<OperatorResult.ListOperatorResultResponse> operatorResults =
            OperatorResult.reader().limit(20).read();

        for (OperatorResult.ListOperatorResultResponse operatorResult : operatorResults) {
            System.out.println(operatorResult.getOutputFormat());
        }
    }
}
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID at twilio.com/console
# Provision API Keys at twilio.com/console/runtime/api-keys
# and set the environment variables. See http://twil.io/secure
# For local testing, you can use your Account SID and Auth token
api_key = ENV['TWILIO_API_KEY']
api_secret = ENV['TWILIO_API_SECRET']
account_sid = ENV['TWILIO_ACCOUNT_SID']
@client = Twilio::REST::Client.new(api_key, api_secret, account_sid)

operator_results = @client
                   .intelligence
                   .v3
                   .operator_results
                   .list(limit: 20)

operator_results.each do |record|
   puts record.output_format
end
```

```bash
curl -X GET "https://intelligence.twilio.com/v3/OperatorResults?PageSize=20" \
-u $TWILIO_API_KEY:$TWILIO_API_SECRET
```

```json
{
  "items": [
    {
      "id": "intelligence_operatorresult_01k6fc25s7epm9qtk8rszbv3q5",
      "accountId": "AC00000000000000000000000000000000",
      "outputFormat": "JSON",
      "intelligenceConfiguration": {
        "id": "intelligence_configuration_01kermhm82e5mr98nbeh1hpmbn",
        "ruleId": "intelligence_configurationrule_01kermhm81fwfvy7j0f7h7v5mr",
        "version": 1
      },
      "conversationId": "conv_conversation_01k1etk2y5f1y9fpe2epfdtvv2",
      "operator": {
        "id": "intelligence_operator_01kcgy1ew0e9x8re6jq542zt8b",
        "version": 1,
        "parameters": {
          "scale": 5
        }
      },
      "dateCreated": "2026-01-15T10:45:30Z",
      "referenceIds": [
        "conv_communication_01k1etk2y5f1y9fpe2epfdtvv2"
      ],
      "executionDetails": {
        "trigger": {
          "on": "CONVERSATION_END",
          "timestamp": "2026-01-15T10:45:25Z"
        },
        "communications": {
          "first": "conv_communication_01k1etk2y5f1y9fpe2epfdtvv2",
          "last": "conv_communication_01k1etk2y5f1y9fpe2epfdtvv9"
        },
        "channels": [
          "VOICE"
        ],
        "participants": [
          {
            "id": "conv_participant_01k1etx3jbfx88476ccja0889c",
            "profileId": "mem_profile_01k6fbz0v4f4e9qtk8p8z7y3w1",
            "type": "CUSTOMER"
          },
          {
            "id": "conv_participant_01k1etx3jbfx88476ccja0889d",
            "type": "HUMAN_AGENT"
          }
        ],
        "resolvedContext": {
          "memory": {
            "profileId": "mem_profile_00000000000000000000000000",
            "memoryStoreId": "mem_store_00000000000000000000000000"
          },
          "knowledge": {
            "sources": [
              {
                "baseId": "know_knowledgebase_00000000000000000000000000",
                "sourceId": "know_knowledge_00000000000000000000000000"
              }
            ]
          }
        }
      },
      "result": {
        "score": 5,
        "explanation": "The agent followed the script closely and addressed all key points effectively."
      }
    },
    {
      "id": "intelligence_operatorresult_01k6fc25s7epm9qtk8rszbv3q6",
      "accountId": "AC00000000000000000000000000000000",
      "outputFormat": "CLASSIFICATION",
      "intelligenceConfiguration": {
        "id": "intelligence_configuration_01kermhm82e5mr98nbeh1hpmbn",
        "ruleId": "intelligence_configurationrule_01kermhm81fwfvy7j0f7h7v5mr",
        "version": 1
      },
      "conversationId": "conv_conversation_01k1etk2y5f1y9fpe2epfdtvv2",
      "operator": {
        "id": "intelligence_operator_01kcgy1ew0e9x8re6jq542zt9c",
        "version": 2,
        "parameters": {}
      },
      "dateCreated": "2026-01-15T10:45:35Z",
      "referenceIds": [
        "conv_communication_01k1etk2y5f1y9fpe2epfdtvv2"
      ],
      "executionDetails": {
        "trigger": {
          "on": "CONVERSATION_END",
          "timestamp": "2026-01-15T10:45:25Z"
        },
        "communications": {
          "first": "conv_communication_01k1etk2y5f1y9fpe2epfdtvv2",
          "last": "conv_communication_01k1etk2y5f1y9fpe2epfdtvv9"
        },
        "channels": [
          "VOICE"
        ],
        "participants": [
          {
            "id": "conv_participant_01k1etx3jbfx88476ccja0889c",
            "type": "CUSTOMER"
          },
          {
            "id": "conv_participant_01k1etx3jbfx88476ccja0889d",
            "type": "HUMAN_AGENT"
          }
        ]
      },
      "result": {
        "label": "POSITIVE"
      }
    }
  ],
  "meta": {
    "key": "items",
    "pageSize": 2,
    "nextToken": "next_page_token_example"
  }
}
```

### Conversations resource

The [Conversations resource](/docs/api/intelligence/v3/Conversations) returns Conversations processed by Conversation Intelligence and includes:

* Conversation metadata
* Intelligence configuration details
* Language operators and rules that ran on the Conversation

You can filter Conversations by:

* Intelligence configuration
* Language operators that have been executed
* Conversation metadata, such as channel, participant information, and date range

The following is an example request and response using the Conversations resource:

Retrieve a list of Conversations processed by Conversation Intelligence

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID at twilio.com/console
// Provision API Keys at twilio.com/console/runtime/api-keys
// and set the environment variables. See http://twil.io/secure
// For local testing, you can use your Account SID and Auth token
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const apiKey = process.env.TWILIO_API_KEY;
const apiSecret = process.env.TWILIO_API_SECRET;
const client = twilio(apiKey, apiSecret, { accountSid: accountSid });

async function listConversations() {
  const conversations = await client.intelligence.v3.conversations.list({
    limit: 20,
  });

  conversations.forEach((c) => console.log(c.id));
}

listConversations();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID at twilio.com/console
# Provision API Keys at twilio.com/console/runtime/api-keys
# and set the environment variables. See http://twil.io/secure
# For local testing, you can use your Account SID and Auth token
api_key = os.environ["TWILIO_API_KEY"]
api_secret = os.environ["TWILIO_API_SECRET"]
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
client = Client(api_key, api_secret, account_sid)

conversations = client.intelligence.v3.conversations.list(limit=20)

for record in conversations:
    print(record.id)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Intelligence.V3;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID at twilio.com/console
        // Provision API Keys at twilio.com/console/runtime/api-keys
        // and set the environment variables. See http://twil.io/secure
        // For local testing, you can use your Account SID and Auth token
        string apiKey = Environment.GetEnvironmentVariable("TWILIO_API_KEY");
        string apiSecret = Environment.GetEnvironmentVariable("TWILIO_API_SECRET");
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");

        TwilioClient.Init(apiKey, apiSecret, accountSid);

        var conversations = await ConversationResource.ReadAsync(limit: 20);

        foreach (var record in conversations) {
            Console.WriteLine(record.Id);
        }
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.intelligence.v3.Conversation;
import com.twilio.base.ResourceSet;

public class Example {
    // Find your Account SID at twilio.com/console
    // Provision API Keys at twilio.com/console/runtime/api-keys
    // and set the environment variables. See http://twil.io/secure
    // For local testing, you can use your Account SID and Auth token
    public static final String API_KEY = System.getenv("TWILIO_API_KEY");
    public static final String API_SECRET = System.getenv("TWILIO_API_SECRET");
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");

    public static void main(String[] args) {
        Twilio.init(API_KEY, API_SECRET, ACCOUNT_SID);
        ResourceSet<Conversation.ListConversationResponse> conversations = Conversation.reader().limit(20).read();

        for (Conversation.ListConversationResponse conversation : conversations) {
            System.out.println(conversation.getId());
        }
    }
}
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID at twilio.com/console
# Provision API Keys at twilio.com/console/runtime/api-keys
# and set the environment variables. See http://twil.io/secure
# For local testing, you can use your Account SID and Auth token
api_key = ENV['TWILIO_API_KEY']
api_secret = ENV['TWILIO_API_SECRET']
account_sid = ENV['TWILIO_ACCOUNT_SID']
@client = Twilio::REST::Client.new(api_key, api_secret, account_sid)

conversations = @client
                .intelligence
                .v3
                .conversations
                .list(limit: 20)

conversations.each do |record|
   puts record.id
end
```

```bash
curl -X GET "https://intelligence.twilio.com/v3/Conversations?PageSize=20" \
-u $TWILIO_API_KEY:$TWILIO_API_SECRET
```

```json
{
  "items": [
    {
      "id": "conv_conversation_01k1etk2y5f1y9fpe2epfdtvv2",
      "accountId": "AC00000000000000000000000000000000",
      "name": "Customer Support Call - Order #12345",
      "status": "CLOSED",
      "createdAt": "2026-01-15T10:30:00Z",
      "updatedAt": "2026-01-15T10:45:30Z",
      "intelligenceConfigurationIds": [
        "intelligence_configuration_01kermhm82e5mr98nbeh1hpmbn"
      ],
      "conversationConfigurationId": "conv_configuration_00000000000000000000000000",
      "channels": [
        "VOICE"
      ],
      "channelIds": [
        "CA1234567890abcdef1234567890abcdef"
      ],
      "participants": [
        {
          "id": "conv_participant_01k1etx3jbfx88476ccja0889c",
          "name": "John Customer",
          "type": "CUSTOMER",
          "addressValues": [
            "+15551234567"
          ]
        },
        {
          "id": "conv_participant_01k1etx3jbfx88476ccja0889d",
          "name": "Sarah Agent",
          "type": "HUMAN_AGENT",
          "addressValues": [
            "agent-sarah@example.com"
          ]
        }
      ],
      "operatorResultIds": [
        "intelligence_operatorresult_01k6fc25s7epm9qtk8rszbv3q5"
      ]
    },
    {
      "id": "conv_conversation_01k1etk2y5f1y9fpe2epfdtvv3",
      "accountId": "AC00000000000000000000000000000000",
      "name": "Sales Inquiry - WhatsApp",
      "status": "ACTIVE",
      "createdAt": "2026-01-15T14:20:00Z",
      "updatedAt": "2026-01-15T14:22:00Z",
      "intelligenceConfigurationIds": [
        "intelligence_configuration_01kermhm82e5mr98nbeh1hpmbn"
      ],
      "conversationConfigurationId": "conv_configuration_00000000000000000000000000",
      "channels": [
        "WHATSAPP"
      ],
      "channelIds": [
        "SM9876543210fedcba9876543210fedcba"
      ],
      "participants": [
        {
          "id": "conv_participant_01k1etx3jbfx88476ccja0889e",
          "name": "Maria Customer",
          "type": "CUSTOMER",
          "addressValues": [
            "whatsapp:+15559876543"
          ]
        },
        {
          "id": "conv_participant_01k1etx3jbfx88476ccja0889f",
          "name": "AI Sales Assistant",
          "type": "AI_AGENT",
          "addressValues": [
            "bot-sales@example.com"
          ]
        }
      ],
      "operatorResultIds": [
        "intelligence_operatorresult_01k6fc25s7epm9qtk8rszbv3q7"
      ]
    }
  ],
  "meta": {
    "key": "items",
    "pageSize": 2,
    "nextToken": "next_page_token_example"
  }
}
```

## Next steps

* [View language operator results in Twilio Console](/docs/conversations/intelligence/explore-language-operator-results).
