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


Resource properties
sidtype: SID<CH>Not PII

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


service_sidtype: SID<IS>Not PII

The SID of the Service(link takes you to an external page) the Channel resource is associated with.


friendly_nametype: stringPII MTL: 30 days

The string that you assigned to describe the resource.


unique_nametype: stringPII MTL: 30 days

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.


attributestype: stringPII MTL: 30 days

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


typetype: enum<STRING>Not PII

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

Possible values:
publicprivate

date_createdtype: string<DATE TIME>Not PII

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


date_updatedtype: string<DATE TIME>Not PII

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_bytype: stringPII MTL: 30 days

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


members_counttype: integerNot PII

The number of Members in the Channel.


messages_counttype: integerNot PII

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


messaging_service_sidtype: SID<MG>Not PII

The unique ID of the Messaging Service(link takes you to an external page) this channel belongs to.


urltype: string<URI>Not PII

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.

Parameters

update-parameters page anchor
Request headers
X-Twilio-Webhook-Enabledtype: enum<STRING>Not PII

The X-Twilio-Webhook-Enabled HTTP request header

Possible values:
truefalse

URI parameters
ServiceSidtype: SID<IS>Not PII
Path Parameter

The unique SID identifier of the Service.


Sidtype: stringNot PII
Path Parameter

A 34 character string that uniquely identifies this Channel.


Request body parameters
Typetype: enum<STRING>Not PII

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

Possible values:
publicprivate

MessagingServiceSidtype: SID<MG>Not PII

The unique ID of the Messaging Service(link takes you to an external page) this channel belongs to.

Migrate public Channel to Conversations

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

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = require('twilio')(accountSid, authToken);
_14
_14
client.chat.v3
_14
.channels('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_14
.update({
_14
type: 'private',
_14
messagingServiceSid: 'MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
_14
})
_14
.then(channel => console.log(channel.friendlyName));

Output

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


Rate this page: