Skip to contentSkip to navigationSkip to topbar

Conversations API (v2) - Conversation endpoints


(information)

Legal information

Conversation Orchestrator, including the APIs, may use artificial intelligence or machine learning technologies and is subject to the terms of the Predictive and Generative AI/ML Features Addendum(link takes you to an external page). For details on AI usage and data, see the AI Nutrition Facts for Real-Time Transcription and Conversation Relay.

Conversation Orchestrator is not a HIPAA Eligible Service or PCI compliant and should not be enabled in workflows that are subject to HIPAA or PCI.

Overview

overview page anchor

A conversation is a record of interactions between participants. It's the container for all communications that occur during an interaction, including voice calls, SMS messages, and other supported channels.

Endpoints


POST/v2/Conversations

Base url: https://conversations.twilio.com (base url)

Create a new conversation

Request

create-conversation-with-config-request page anchor

Request body

create-conversation-with-config-request-body page anchor
Encoding type:application/json
Schema
Property nameTypeRequiredPIIDescriptionChild properties
configurationIdstring
required
Not PII

The ID of an existing configuration.

Example: conv_configuration_01k1etx3jbfx88476ccja0889d

namestring

Optional

The name of the conversation.

Example: Support Chat

configurationobject

Optional

Conversation configuration settings.


participantsarray[object]

Optional

Optional list of Participants to create with the Conversation.

Max items: 50
201400404409429500503

Created

SchemaExample
Property nameTypeRequiredPIIDescriptionChild properties
idstring

Optional

Conversation ID.

Example: conv_conversation_01k1etk2y5f1y9fpe2epfdtvv2

accountIdstring

Optional

Account ID.

Example: ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

configurationIdstring

Optional

Configuration ID.

Example: conv_configuration_01k1etk2y5f1y9fpe2epfdtvv2

statusenum<string>

Optional

Conversation status.

Example: ACTIVEPossible values:
ACTIVEINACTIVECLOSED

namestring

Optional

Conversation name.

Example: Customer Support Chat

createdAtstring<date-time>

Optional

Timestamp when this Conversation was created.

Example: 2023-07-01T12:00:00Z

updatedAtstring<date-time>

Optional

Timestamp when this Conversation was last updated.

Example: 2023-07-01T12:30:00Z

configurationobject

Optional

Full configuration settings for this Conversation.


participantsarray[object]

Optional

Participants in this Conversation.

Create a new ConversationLink to code sample: Create a new Conversation
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 and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createConversationWithConfig() {
11
const conversation = await client.conversations.v2.conversations.create({
12
configurationId: "configurationId",
13
});
14
15
console.log(conversation.id);
16
}
17
18
createConversationWithConfig();

Response

Note about this response
1
{
2
"accountId": "ZGkrHSypTsudrGkmdpJJ",
3
"configuration": {
4
"displayName": "My Support Config",
5
"description": "description",
6
"conversationGroupingType": "GROUP_BY_PROFILE",
7
"memoryStoreId": "memoryStoreId",
8
"channelSettings": {},
9
"statusCallbacks": [
10
{
11
"url": "https://www.example.com",
12
"method": "POST"
13
}
14
],
15
"intelligenceConfigurationIds": [
16
"intelligenceConfigurationIds"
17
],
18
"memoryExtractionEnabled": false,
19
"conversationsV1Bridge": {
20
"serviceId": "IS00000000000000000000000000000000"
21
}
22
},
23
"configurationId": "configurationId",
24
"createdAt": "2009-07-06T20:30:00Z",
25
"id": "id",
26
"name": "Miss Christine Morgan",
27
"participants": [
28
{
29
"id": "id",
30
"conversationId": "conversationId",
31
"accountId": "accountId",
32
"name": "name",
33
"type": "CUSTOMER",
34
"profileId": "profileId",
35
"addresses": [
36
{
37
"channel": "SMS",
38
"address": "address",
39
"channelId": "channelId"
40
}
41
],
42
"createdAt": "2009-07-06T20:30:00Z",
43
"updatedAt": "2009-07-06T20:30:00Z"
44
}
45
],
46
"status": "ACTIVE",
47
"updatedAt": "2009-07-06T20:30:00Z"
48
}

GET/v2/Conversations

Base url: https://conversations.twilio.com (base url)

Retrieve a list of Conversations.

Property nameTypeRequiredPIIDescription
statusarray[enum<string>]

Optional

Filters for specific statuses

Possible values:
ACTIVEINACTIVECLOSED

channelIdstring

Optional

The resource identifier (such as callSid or messageSid) to filter conversations.


pageSizeinteger

Optional

Maximum number of items to return in a single response

Default: 50Example: 50Minimum: 1Maximum: 1000

pageTokenstring

Optional

A URL-safe, base64-encoded token representing the page of results to return

Example: eyJwYWdlIjoyLCJxdWVyeSI6ImJvb2tzIn0=
200400404429500503

OK

Schema
Property nameTypeRequiredPIIDescriptionChild properties
conversationsarray[object]

Optional

Min items: 0

metaobject

Optional

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 and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listConversationByAccount() {
11
const conversations = await client.conversations.v2.conversations.list({
12
limit: 20,
13
});
14
15
conversations.forEach((c) => console.log(c.id));
16
}
17
18
listConversationByAccount();

Response

Note about this response
1
{
2
"conversations": [
3
{
4
"id": "id",
5
"accountId": "accountId",
6
"configurationId": "configurationId",
7
"status": "ACTIVE",
8
"name": "name",
9
"createdAt": "2009-07-06T20:30:00Z",
10
"updatedAt": "2009-07-06T20:30:00Z",
11
"configuration": {
12
"displayName": "My Support Config",
13
"description": "description",
14
"conversationGroupingType": "GROUP_BY_PROFILE",
15
"memoryStoreId": "memoryStoreId",
16
"channelSettings": {},
17
"statusCallbacks": [
18
{
19
"url": "https://www.example.com",
20
"method": "POST"
21
}
22
],
23
"intelligenceConfigurationIds": [
24
"intelligenceConfigurationIds"
25
],
26
"memoryExtractionEnabled": false,
27
"conversationsV1Bridge": {
28
"serviceId": "IS00000000000000000000000000000000"
29
}
30
},
31
"participants": [
32
{
33
"id": "id",
34
"conversationId": "conversationId",
35
"accountId": "accountId",
36
"name": "name",
37
"type": "CUSTOMER",
38
"profileId": "profileId",
39
"addresses": [
40
{
41
"channel": "SMS",
42
"address": "address",
43
"channelId": "channelId"
44
}
45
],
46
"createdAt": "2009-07-06T20:30:00Z",
47
"updatedAt": "2009-07-06T20:30:00Z"
48
}
49
]
50
}
51
],
52
"meta": {
53
"key": "key",
54
"pageSize": 20,
55
"previousToken": "previousToken",
56
"nextToken": "nextToken"
57
}
58
}

GET/v2/Conversations/{Sid}

Base url: https://conversations.twilio.com (base url)

Retrieve a Conversation.

Property nameTypeRequiredPIIDescription
sidstring
required
200400404429500503

OK

SchemaExample
Property nameTypeRequiredPIIDescriptionChild properties
idstring

Optional

Conversation ID.

Example: conv_conversation_01k1etk2y5f1y9fpe2epfdtvv2

accountIdstring

Optional

Account ID.

Example: ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

configurationIdstring

Optional

Configuration ID.

Example: conv_configuration_01k1etk2y5f1y9fpe2epfdtvv2

statusenum<string>

Optional

Conversation status.

Example: ACTIVEPossible values:
ACTIVEINACTIVECLOSED

namestring

Optional

Conversation name.

Example: Customer Support Chat

createdAtstring<date-time>

Optional

Timestamp when this Conversation was created.

Example: 2023-07-01T12:00:00Z

updatedAtstring<date-time>

Optional

Timestamp when this Conversation was last updated.

Example: 2023-07-01T12:30:00Z

configurationobject

Optional

Full configuration settings for this Conversation.


participantsarray[object]

Optional

Participants in this Conversation.

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 and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchConversation() {
11
const conversation = await client.conversations.v2
12
.conversations("Sid")
13
.fetch();
14
15
console.log(conversation.id);
16
}
17
18
fetchConversation();

Response

Note about this response
1
{
2
"accountId": "ZGkrHSypTsudrGkmdpJJ",
3
"configuration": {
4
"displayName": "My Support Config",
5
"description": "description",
6
"conversationGroupingType": "GROUP_BY_PROFILE",
7
"memoryStoreId": "memoryStoreId",
8
"channelSettings": {},
9
"statusCallbacks": [
10
{
11
"url": "https://www.example.com",
12
"method": "POST"
13
}
14
],
15
"intelligenceConfigurationIds": [
16
"intelligenceConfigurationIds"
17
],
18
"memoryExtractionEnabled": false,
19
"conversationsV1Bridge": {
20
"serviceId": "IS00000000000000000000000000000000"
21
}
22
},
23
"configurationId": "configurationId",
24
"createdAt": "2009-07-06T20:30:00Z",
25
"id": "id",
26
"name": "Miss Christine Morgan",
27
"participants": [
28
{
29
"id": "id",
30
"conversationId": "conversationId",
31
"accountId": "accountId",
32
"name": "name",
33
"type": "CUSTOMER",
34
"profileId": "profileId",
35
"addresses": [
36
{
37
"channel": "SMS",
38
"address": "address",
39
"channelId": "channelId"
40
}
41
],
42
"createdAt": "2009-07-06T20:30:00Z",
43
"updatedAt": "2009-07-06T20:30:00Z"
44
}
45
],
46
"status": "ACTIVE",
47
"updatedAt": "2009-07-06T20:30:00Z"
48
}

PUT/v2/Conversations/{Sid}

Base url: https://conversations.twilio.com (base url)

Update an existing conversation

Property nameTypeRequiredPIIDescription
sidstring
required
Encoding type:application/json
Schema
Property nameTypeRequiredPIIDescriptionChild properties
namestring

Optional

The name of the Conversation.

Example: Support Chat

statusenum<string>
required

The state of the Conversation.

Possible values:
ACTIVEINACTIVECLOSED
200400404429500503

OK

SchemaExample
Property nameTypeRequiredPIIDescriptionChild properties
idstring

Optional

Conversation ID.

Example: conv_conversation_01k1etk2y5f1y9fpe2epfdtvv2

accountIdstring

Optional

Account ID.

Example: ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

configurationIdstring

Optional

Configuration ID.

Example: conv_configuration_01k1etk2y5f1y9fpe2epfdtvv2

statusenum<string>

Optional

Conversation status.

Example: ACTIVEPossible values:
ACTIVEINACTIVECLOSED

namestring

Optional

Conversation name.

Example: Customer Support Chat

createdAtstring<date-time>

Optional

Timestamp when this Conversation was created.

Example: 2023-07-01T12:00:00Z

updatedAtstring<date-time>

Optional

Timestamp when this Conversation was last updated.

Example: 2023-07-01T12:30:00Z

configurationobject

Optional

Full configuration settings for this Conversation.


participantsarray[object]

Optional

Participants in this Conversation.

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 and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function updateConversationById() {
11
const conversation = await client.conversations.v2
12
.conversations("Sid")
13
.update({
14
status: "ACTIVE",
15
});
16
17
console.log(conversation.id);
18
}
19
20
updateConversationById();

Response

Note about this response
1
{
2
"accountId": "ZGkrHSypTsudrGkmdpJJ",
3
"configuration": {
4
"displayName": "My Support Config",
5
"description": "description",
6
"conversationGroupingType": "GROUP_BY_PROFILE",
7
"memoryStoreId": "memoryStoreId",
8
"channelSettings": {},
9
"statusCallbacks": [
10
{
11
"url": "https://www.example.com",
12
"method": "POST"
13
}
14
],
15
"intelligenceConfigurationIds": [
16
"intelligenceConfigurationIds"
17
],
18
"memoryExtractionEnabled": false,
19
"conversationsV1Bridge": {
20
"serviceId": "IS00000000000000000000000000000000"
21
}
22
},
23
"configurationId": "configurationId",
24
"createdAt": "2009-07-06T20:30:00Z",
25
"id": "id",
26
"name": "Miss Christine Morgan",
27
"participants": [
28
{
29
"id": "id",
30
"conversationId": "conversationId",
31
"accountId": "accountId",
32
"name": "name",
33
"type": "CUSTOMER",
34
"profileId": "profileId",
35
"addresses": [
36
{
37
"channel": "SMS",
38
"address": "address",
39
"channelId": "channelId"
40
}
41
],
42
"createdAt": "2009-07-06T20:30:00Z",
43
"updatedAt": "2009-07-06T20:30:00Z"
44
}
45
],
46
"status": "ACTIVE",
47
"updatedAt": "2009-07-06T20:30:00Z"
48
}

Partially Update a Conversation

patch-conversation-by-id page anchor

PATCH/v2/Conversations/{Sid}

Base url: https://conversations.twilio.com (base url)

Partially update the details of an existing Conversation.

Property nameTypeRequiredPIIDescription
sidstring
required
Encoding type:application/json
Schema
Property nameTypeRequiredPIIDescriptionChild properties
namestring

Optional

The name of the Conversation.

Example: Support Chat

statusenum<string>

Optional

The state of the Conversation.

Possible values:
ACTIVEINACTIVECLOSED

configurationobject

Optional

Partial configuration update for an existing conversation. Only statusCallbacks can be modified.

200400404429500503

OK

SchemaExample
Property nameTypeRequiredPIIDescriptionChild properties
idstring

Optional

Conversation ID.

Example: conv_conversation_01k1etk2y5f1y9fpe2epfdtvv2

accountIdstring

Optional

Account ID.

Example: ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

configurationIdstring

Optional

Configuration ID.

Example: conv_configuration_01k1etk2y5f1y9fpe2epfdtvv2

statusenum<string>

Optional

Conversation status.

Example: ACTIVEPossible values:
ACTIVEINACTIVECLOSED

namestring

Optional

Conversation name.

Example: Customer Support Chat

createdAtstring<date-time>

Optional

Timestamp when this Conversation was created.

Example: 2023-07-01T12:00:00Z

updatedAtstring<date-time>

Optional

Timestamp when this Conversation was last updated.

Example: 2023-07-01T12:30:00Z

configurationobject

Optional

Full configuration settings for this Conversation.


participantsarray[object]

Optional

Participants in this Conversation.

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 and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function patchConversationById() {
11
const conversation = await client.conversations.v2
12
.conversations("Sid")
13
.patch({
14
name: "Miss Christine Morgan",
15
});
16
17
console.log(conversation.id);
18
}
19
20
patchConversationById();

Response

Note about this response
1
{
2
"accountId": "ZGkrHSypTsudrGkmdpJJ",
3
"configuration": {
4
"displayName": "My Support Config",
5
"description": "description",
6
"conversationGroupingType": "GROUP_BY_PROFILE",
7
"memoryStoreId": "memoryStoreId",
8
"channelSettings": {},
9
"statusCallbacks": [
10
{
11
"url": "https://www.example.com",
12
"method": "POST"
13
}
14
],
15
"intelligenceConfigurationIds": [
16
"intelligenceConfigurationIds"
17
],
18
"memoryExtractionEnabled": false,
19
"conversationsV1Bridge": {
20
"serviceId": "IS00000000000000000000000000000000"
21
}
22
},
23
"configurationId": "configurationId",
24
"createdAt": "2009-07-06T20:30:00Z",
25
"id": "id",
26
"name": "Miss Christine Morgan",
27
"participants": [
28
{
29
"id": "id",
30
"conversationId": "conversationId",
31
"accountId": "accountId",
32
"name": "name",
33
"type": "CUSTOMER",
34
"profileId": "profileId",
35
"addresses": [
36
{
37
"channel": "SMS",
38
"address": "address",
39
"channelId": "channelId"
40
}
41
],
42
"createdAt": "2009-07-06T20:30:00Z",
43
"updatedAt": "2009-07-06T20:30:00Z"
44
}
45
],
46
"status": "ACTIVE",
47
"updatedAt": "2009-07-06T20:30:00Z"
48
}

Delete a Conversation (async)

delete-conversation-async page anchor

DELETE/v2/Conversations/{Sid}

Base url: https://conversations.twilio.com (base url)

Asynchronously delete a conversation and all associated data. Returns 202 Accepted with an Operation-Id for status tracking via GET /v2/ControlPlane/Operations/{operationId}.

Property nameTypeRequiredPIIDescription
idempotency-Keystring

Optional

Client-generated UUID key to ensure idempotent behavior. Submitting the same key returns the original response without creating a duplicate operation. Keys are scoped to account + region with a 24-hour TTL.

Pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Property nameTypeRequiredPIIDescription
sidstring
required
202400404409429500503

Operation accepted for asynchronous processing

SchemaExample
Property nameTypeRequiredPIIDescriptionChild properties
statusUrlstring<uri>

Optional

URL to poll for operation status.

Example: https://conversations.twilio.com/v2/ControlPlane/Operations/proc_job_01h9d8r0vte3hz8tykdj329t7r

relatedobject

Optional

Named resource identifiers associated with this operation. Keys depend on the operation type:

  • config-create, config-update, config-delete: configurationId
  • conversation-delete: conversationId
Example: {"configurationId":"cfg_configuration_01h9d8r0vte3hz8tykdj329t7r"}
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 and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function deleteConversationAsync() {
11
await client.conversations.v2.conversations("Sid").remove();
12
}
13
14
deleteConversationAsync();

Response

Note about this response
1
{
2
"related": {},
3
"statusUrl": "https://www.example.com"
4
}