The Service Resource is currently available as a Public Beta product. This means that some features for configuring your Messaging Service via the REST API are not yet implemented, and others may be changed before the product is declared Generally Available. Messaging Service Configuration through the Twilio Console is Generally Available.
Public Beta products are not covered by a Twilio SLA.
The resources for sending Messages with a Messaging Service are Generally Available.
The ChannelSender subresource of a Service Resource represents a channel sender that is associated with a Messaging Service, such as WhatsApp.
When sending a message with your Messaging Service to a channel destination, Twilio will select a channel sender of that corresponding channel from the service for delivery.
See Twilio Channels: A New Way Reach Customers in Apps They Already Use for more information on Twilio Channels.
The SID of the Account that created the ChannelSender resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Service the resource is associated with.
^MG[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The unique string that we created to identify the ChannelSender resource.
^XE[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
A string value that identifies the sender type e.g WhatsApp, Messenger.
The date and time in GMT when the resource was created specified in ISO 8601 format.
The date and time in GMT when the resource was last updated specified in ISO 8601 format.
The absolute URL of the ChannelSender resource.
POST https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/ChannelSenders
application/x-www-form-urlencoded
The SID of the Channel Sender being added to the Service.
^XE[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createChannelSender() {11const channelSender = await client.messaging.v112.services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.channelSenders.create({ sid: "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" });1415console.log(channelSender.accountSid);16}1718createChannelSender();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"sender": "whatsapp:+12487960483",6"sender_type": "WhatsApp",7"country_code": "US",8"date_created": "2023-07-30T20:12:31Z",9"date_updated": "2023-07-30T20:12:33Z",10"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelSenders/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"11}
GET https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/ChannelSenders/{Sid}
The SID of the Service to fetch the resource from.
^MG[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the ChannelSender resource to fetch.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchChannelSender() {11const channelSender = await client.messaging.v112.services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.channelSenders("XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.fetch();1516console.log(channelSender.accountSid);17}1819fetchChannelSender();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"sender": "whatsapp:+12487960483",6"sender_type": "WhatsApp",7"country_code": "US",8"date_created": "2023-07-30T20:12:31Z",9"date_updated": "2023-07-30T20:12:33Z",10"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelSenders/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"11}
GET https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/ChannelSenders
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listChannelSender() {11const channelSenders = await client.messaging.v112.services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.channelSenders.list({ limit: 20 });1415channelSenders.forEach((c) => console.log(c.accountSid));16}1718listChannelSender();
1{2"meta": {3"page": 0,4"page_size": 20,5"first_page_url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelSenders?PageSize=20&Page=0",6"previous_page_url": null,7"next_page_url": null,8"key": "senders",9"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelSenders?PageSize=20&Page=0"10},11"senders": [12{13"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",14"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15"sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",16"sender": "whatsapp:+12487960483",17"sender_type": "WhatsApp",18"country_code": "US",19"date_created": "2023-07-30T20:12:31Z",20"date_updated": "2023-07-30T20:12:33Z",21"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelSenders/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"22},23{24"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",25"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",26"sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab",27"sender": "messenger:104794531907950",28"sender_type": "Messenger",29"country_code": "US",30"date_created": "2023-07-30T20:12:31Z",31"date_updated": "2023-07-30T20:12:33Z",32"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelSenders/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab"33},34{35"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",36"messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",37"sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac",38"sender": "rcs:ms_dev_ttatqler_agent",39"sender_type": "RCS",40"country_code": "US",41"date_created": "2023-07-30T20:12:31Z",42"date_updated": "2023-07-30T20:12:33Z",43"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelSenders/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaac"44}45]46}
DELETE https://messaging.twilio.com/v1/Services/{MessagingServiceSid}/ChannelSenders/{Sid}
Returns "204 NO CONTENT" if the channel sender was successfully removed from the Service.
The SID of the Service to delete the resource from.
^MG[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Channel Sender resource to delete.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function deleteChannelSender() {11await client.messaging.v112.services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.channelSenders("XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")14.remove();15}1617deleteChannelSender();