Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Chat Channel Migration Resource


A Channel is a Programmable Chat object that is equivalent to a Conversation in the Conversations API.

Please see the Conversation Resource for Conversations that are already available to your Conversations application.

Only 'private' type Channels are automatically migrated to Conversations. For 'public' type Channels, please use this API to migrate them to 'private' type.


API Base URL

api-base-url page anchor

_10
https://chat.twilio.com/v3

There is only one API endpoint on the v3 Chat API:


_10
POST /Services/ISxx/Channels/CHxx


Property nameTypePIIDescription
sidSID<CH>
Not PII

The unique string that we created to identify the Channel resource.

Pattern: ^CH[0-9a-fA-F]{32}$Min length: 34Max length: 34

account_sidSID<AC>

The SID of the Account that created the Channel resource.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

service_sidSID<IS>

The SID of the Service the Channel resource is associated with.

Pattern: ^IS[0-9a-fA-F]{32}$Min length: 34Max length: 34

friendly_namestring
PII MTL: 30 days

The string that you assigned to describe the resource.


unique_namestring

An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's sid in the URL.


attributesstring

The JSON string that stores application-specific data. If attributes have not been set, {} is returned.


typeenum<string>

The visibility of the channel. Can be: public or private.

Possible values:
publicprivate

date_updatedstring<date-time>

The date and time in GMT when the resource was last updated specified in ISO 8601(link takes you to an external page) format.


created_bystring

The identity of the User that created the channel. If the Channel was created by using the API, the value is system.


members_countinteger

The number of Members in the Channel.


messages_countinteger

The number of Messages that have been passed in the Channel.


messaging_service_sidSID<MG>

The unique ID of the Messaging Service this channel belongs to.

Pattern: ^MG[0-9a-fA-F]{32}$Min length: 34Max length: 34

urlstring<uri>

The absolute URL of the Channel resource.


POST https://chat.twilio.com/v3/Services/{ServiceSid}/Channels/{Sid}

Use this API to change a Channel's type from public to private. This makes it available in Conversations.

(information)

Info

Read here to determine if you need to include a Messaging Service SID in your request.

Headers

headers page anchor
Property nameTypeRequiredPIIDescription
X-Twilio-Webhook-Enabledenum<string>Optional

The X-Twilio-Webhook-Enabled HTTP request header

Possible values:
truefalse
Property nameTypeRequiredPIIDescription
ServiceSidSID<IS>required

The unique SID identifier of the Service.

Pattern: ^IS[0-9a-fA-F]{32}$Min length: 34Max length: 34

Sidstringrequired

A 34 character string that uniquely identifies this Channel.

Property nameTypeRequiredPIIDescription
Typeenum<string>Optional

TThe Type for this Channel to migrate to. Can only be private. Migration to 'public' is not allowed.

Possible values:
publicprivate

MessagingServiceSidSID<MG>Optional

The unique ID of the Messaging Service this channel belongs to.

Pattern: ^MG[0-9a-fA-F]{32}$Min length: 34Max length: 34

Migrate public Channel to Conversations

migrate-public-channel-to-conversations page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_21
// Download the helper library from https://www.twilio.com/docs/node/install
_21
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_21
_21
// Find your Account SID and Auth Token at twilio.com/console
_21
// and set the environment variables. See http://twil.io/secure
_21
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_21
const authToken = process.env.TWILIO_AUTH_TOKEN;
_21
const client = twilio(accountSid, authToken);
_21
_21
async function updateChannel() {
_21
const channel = await client.chat.v3
_21
.channels("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "Sid")
_21
.update({
_21
messagingServiceSid: "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_21
type: "private",
_21
});
_21
_21
console.log(channel.sid);
_21
}
_21
_21
updateChannel();

Output

_16
{
_16
"sid": "Sid",
_16
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_16
"service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_16
"messaging_service_sid": "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_16
"friendly_name": "friendly_name",
_16
"unique_name": "unique_name",
_16
"attributes": "{ \"foo\": \"bar\" }",
_16
"type": "private",
_16
"date_created": "2015-12-16T22:18:37Z",
_16
"date_updated": "2015-12-16T22:18:38Z",
_16
"created_by": "username",
_16
"members_count": 0,
_16
"messages_count": 0,
_16
"url": "https://chat.twilio.com/v3/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_16
}


Rate this page: