Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

Conversation Orchestrator quickstart


In this quickstart, you'll create a conversation configuration with capture rules. Conversation Orchestrator then observes your existing Twilio traffic and groups matching messages and calls into conversations.

See Create conversations programmatically or Connect Conversations API (classic) for other ways to start using Conversation Orchestrator.

(warning)

Voice transcription fees

When you use Conversation Orchestrator with the voice channel, Twilio transcribes your calls to populate the conversation. Transcription fees apply. For pricing details, see Twilio Voice pricing(link takes you to an external page).


Prerequisites

prerequisites page anchor

Complete the prerequisites:


Create a memory store and conversation configuration

create-a-memory-store-and-conversation-configuration page anchor

A conversation configuration defines how Conversation Orchestrator groups your interaction traffic. To link conversations with customer profiles, you also need a memory store. Create both using the Console or the API.

ConsoleAPI

To create a conversation configuration using the Twilio Console, follow these steps:

  1. Sign in to the Twilio Console(link takes you to an external page).
  2. Go to Products & services > Conversation Orchestrator > Conversation configurations(link takes you to an external page).
  3. Click Create a Conversation configuration.
  4. On the Name Configuration step, enter a name and description, and then click Next.
  5. On the Messaging and chat traffic step, click Next. This quickstart uses voice traffic, so no selections are needed here.
  6. On the Voice traffic step, do the following:
    1. Select the Set up automatic capture checkbox.
    2. From the Voice phone numbers list, select your Twilio phone number.
    3. Click Next.
  7. On the Configure lifecycle step, accept the default Basic lifecycle, select a "Closed" timeout value for each active channel, and then click Next.
  8. On the Enable Conversation Memory step, create a memory store:
    1. Click Create new memory store.
    2. In the Memory store name field, enter a name.
    3. Click Save.
  9. From the Memory store list, select the memory store you just created.
  10. Clear the Turn on observations and summaries checkbox.
  11. Click Next.
  12. On the Voice transcription step, review the transcription summary. If this is your first time using AI features on this account, select the Predictive and Generative AI/ML Features Addendum checkbox to agree to the terms.
  13. Click Next.
  14. On the Summary step, review your settings and click Create Conversation configuration.
  15. Copy the conversation configuration ID for use in the next steps.

Send an SMS from your Twilio phone number using the Programmable Messaging API:

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID at twilio.com/console
5
// Provision API Keys at twilio.com/console/runtime/api-keys
6
// and set the environment variables. See http://twil.io/secure
7
// For local testing, you can use your Account SID and Auth token
8
const accountSid = process.env.TWILIO_ACCOUNT_SID;
9
const apiKey = process.env.TWILIO_API_KEY;
10
const apiSecret = process.env.TWILIO_API_SECRET;
11
const client = twilio(apiKey, apiSecret, { accountSid: accountSid });
12
13
async function createMessage() {
14
const message = await client.messages.create({
15
body: "Hello there",
16
from: "TWILIO_PHONE_NUMBER",
17
to: "TEST_PHONE_NUMBER",
18
});
19
20
console.log(message.body);
21
}
22
23
createMessage();

Replace TWILIO_PHONE_NUMBER with your Twilio phone number and TEST_PHONE_NUMBER with a test phone number. Conversation Orchestrator detects the message, creates a conversation, adds customer and agent participants, and records the message as a communication.


Conversation Orchestrator captures voice calls the same way it captures SMS messages.

  1. From your test phone number, call your Twilio phone number.
  2. When the call connects, say a few words so the call has content to transcribe.
  3. End the call.

Use the Conversation Orchestrator API to verify that your test communications are in a conversation.

List conversations

list-conversations page anchor

To retrieve all your conversations, send a GET request:

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID at twilio.com/console
5
// Provision API Keys at twilio.com/console/runtime/api-keys
6
// and set the environment variables. See http://twil.io/secure
7
// For local testing, you can use your Account SID and Auth token
8
const accountSid = process.env.TWILIO_ACCOUNT_SID;
9
const apiKey = process.env.TWILIO_API_KEY;
10
const apiSecret = process.env.TWILIO_API_SECRET;
11
const client = twilio(apiKey, apiSecret, { accountSid: accountSid });
12
13
async function listConversationByAccount() {
14
const conversations = await client.conversations.v2.conversations.list({
15
limit: 20,
16
});
17
18
conversations.forEach((c) => console.log(c.id));
19
}
20
21
listConversationByAccount();

The response includes a list of conversations. Note the id of the conversation you want to inspect.

To retrieve the list of participants in a conversation, send a GET request to the Participants endpoint:

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID at twilio.com/console
5
// Provision API Keys at twilio.com/console/runtime/api-keys
6
// and set the environment variables. See http://twil.io/secure
7
// For local testing, you can use your Account SID and Auth token
8
const accountSid = process.env.TWILIO_ACCOUNT_SID;
9
const apiKey = process.env.TWILIO_API_KEY;
10
const apiSecret = process.env.TWILIO_API_SECRET;
11
const client = twilio(apiKey, apiSecret, { accountSid: accountSid });
12
13
async function listParticipantByConversation() {
14
const participants = await client.conversations.v2
15
.participants("CONVERSATION_ID")
16
.list({ limit: 20 });
17
18
participants.forEach((p) => console.log(p.id));
19
}
20
21
listParticipantByConversation();

Replace CONVERSATION_ID with your conversation ID.

To see the messages in a conversation, send a GET request to the Communications endpoint:

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID at twilio.com/console
5
// Provision API Keys at twilio.com/console/runtime/api-keys
6
// and set the environment variables. See http://twil.io/secure
7
// For local testing, you can use your Account SID and Auth token
8
const accountSid = process.env.TWILIO_ACCOUNT_SID;
9
const apiKey = process.env.TWILIO_API_KEY;
10
const apiSecret = process.env.TWILIO_API_SECRET;
11
const client = twilio(apiKey, apiSecret, { accountSid: accountSid });
12
13
async function listCommunicationByConversation() {
14
const communications = await client.conversations.v2
15
.communications("CONVERSATION_ID")
16
.list({ limit: 20 });
17
18
communications.forEach((c) => console.log(c.id));
19
}
20
21
listCommunicationByConversation();

Replace CONVERSATION_ID with your conversation ID.

This endpoint returns a list of communications. The content property of each communication contains a transcription of your voice call or the body of your text message.