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

Service Resource


(warning)

Public Beta

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.

When sending a message with a Messaging Service, you can improve message performance by enabling the included features.

Developers can associate phone numbers, short codes, and alpha sender IDs to an instance of a Messaging Service. The Service handles all inbound and outbound behaviors for the phone numbers and shortcodes.

Twilio Console

You can manage your Messaging Services through the Twilio Console when logged in.


Messaging Services Resource

The Services resource of Messaging represents a set of configurable behavior for sending and receiving Messages.

Subresources

The Services resource also has phone numbers, short codes, and alpha sender IDs subresources for managing the phone numbers, short codes, and alpha sender IDs associated with the Service.

Resource URI

All URLs in this documentation use the following base URL:


_10
https://messaging.twilio.com/v1


Service Properties

Property nameTypePIIDescription
sidSID<MG>
Not PII

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

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

account_sidSID<AC>

The SID of the Account that created the Service resource.

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

friendly_namestring

The string that you assigned to describe the resource.


date_createdstring<date-time>

The date and time in GMT when the resource was created specified in ISO 8601 format.


date_updatedstring<date-time>

The date and time in GMT when the resource was last updated specified in ISO 8601 format.


inbound_request_urlstring<uri>

The URL we call using inbound_method when a message is received by any phone number or short code in the Service. When this property is null, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the use_inbound_webhook_on_number field is enabled then the webhook url defined on the phone number will override the inbound_request_url defined for the Messaging Service.


inbound_methodenum<http-method>

The HTTP method we use to call inbound_request_url. Can be GET or POST.

Possible values:
GETPOST

fallback_urlstring<uri>

The URL that we call using fallback_method if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the use_inbound_webhook_on_number field is enabled then the webhook url defined on the phone number will override the fallback_url defined for the Messaging Service.


fallback_methodenum<http-method>

The HTTP method we use to call fallback_url. Can be: GET or POST.

Possible values:
GETPOST

status_callbackstring<uri>

The URL we call to pass status updates about message delivery.


sticky_senderboolean

Whether to enable Sticky Sender on the Service instance.


mms_converterboolean

Whether to enable the MMS Converter for messages sent through the Service instance.


smart_encodingboolean

Whether to enable Smart Encoding for messages sent through the Service instance.


scan_message_contentenum<string>

Reserved.

Possible values:
inheritenabledisable

fallback_to_long_codeboolean

[OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures.


area_code_geomatchboolean

Whether to enable Area Code Geomatch on the Service Instance.


synchronous_validationboolean

Reserved.


validity_periodinteger

How long, in seconds, messages sent from the Service are valid. Can be an integer from 1 to 14,400.


urlstring<uri>

The absolute URL of the Service resource.


linksobject<uri-map>

The absolute URLs of related resources.


usecasestring

A string that describes the scenario in which the Messaging Service will be used. Possible values are notifications, marketing, verification, discussion, poll, undeclared.


us_app_to_person_registeredboolean

Whether US A2P campaign is registered for this Service.


use_inbound_webhook_on_numberboolean

A boolean value that indicates either the webhook url configured on the phone number will be used or inbound_request_url/fallback_url url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the inbound_request_url/fallback_url defined for the Messaging Service.


Create a Service resource

POST https://messaging.twilio.com/v1/Services

Request body parameters

Property nameTypeRequiredPIIDescription
FriendlyNamestringrequired

A descriptive string that you create to describe the resource. It can be up to 64 characters long.


InboundRequestUrlstring<uri>Optional

The URL we call using inbound_method when a message is received by any phone number or short code in the Service. When this property is null, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the use_inbound_webhook_on_number field is enabled then the webhook url defined on the phone number will override the inbound_request_url defined for the Messaging Service.


InboundMethodenum<http-method>Optional

The HTTP method we should use to call inbound_request_url. Can be GET or POST and the default is POST.

Possible values:
GETPOST

FallbackUrlstring<uri>Optional

The URL that we call using fallback_method if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the use_inbound_webhook_on_number field is enabled then the webhook url defined on the phone number will override the fallback_url defined for the Messaging Service.


FallbackMethodenum<http-method>Optional

The HTTP method we should use to call fallback_url. Can be: GET or POST.

Possible values:
GETPOST

StatusCallbackstring<uri>Optional

The URL we should call to pass status updates about message delivery.


StickySenderbooleanOptional

Whether to enable Sticky Sender on the Service instance.


MmsConverterbooleanOptional

Whether to enable the MMS Converter for messages sent through the Service instance.


SmartEncodingbooleanOptional

Whether to enable Smart Encoding for messages sent through the Service instance.


ScanMessageContentenum<string>Optional

Reserved.

Possible values:
inheritenabledisable

FallbackToLongCodebooleanOptional

[OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures.


AreaCodeGeomatchbooleanOptional

Whether to enable Area Code Geomatch on the Service Instance.


ValidityPeriodintegerOptional

How long, in seconds, messages sent from the Service are valid. Can be an integer from 1 to 14,400.


SynchronousValidationbooleanOptional

Reserved.


UsecasestringOptional

A string that describes the scenario in which the Messaging Service will be used. Possible values are notifications, marketing, verification, discussion, poll, undeclared.


UseInboundWebhookOnNumberbooleanOptional

A boolean value that indicates either the webhook url configured on the phone number will be used or inbound_request_url/fallback_url url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the inbound_request_url/fallback_url defined for the Messaging Service.

Create a Service

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function createService() {
_18
const service = await client.messaging.v1.services.create({
_18
friendlyName: "FriendlyName",
_18
});
_18
_18
console.log(service.sid);
_18
}
_18
_18
createService();

Output

_34
{
_34
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_34
"sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_34
"date_created": "2015-07-30T20:12:31Z",
_34
"date_updated": "2015-07-30T20:12:33Z",
_34
"friendly_name": "FriendlyName",
_34
"inbound_request_url": "https://www.example.com/",
_34
"inbound_method": "POST",
_34
"fallback_url": "https://www.example.com",
_34
"fallback_method": "GET",
_34
"status_callback": "https://www.example.com",
_34
"sticky_sender": true,
_34
"smart_encoding": false,
_34
"mms_converter": true,
_34
"fallback_to_long_code": true,
_34
"scan_message_content": "inherit",
_34
"area_code_geomatch": true,
_34
"validity_period": 600,
_34
"synchronous_validation": true,
_34
"usecase": "marketing",
_34
"us_app_to_person_registered": false,
_34
"use_inbound_webhook_on_number": true,
_34
"sending_windows": [],
_34
"links": {
_34
"phone_numbers": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers",
_34
"short_codes": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes",
_34
"alpha_senders": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders",
_34
"messages": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages",
_34
"us_app_to_person": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Compliance/Usa2p",
_34
"us_app_to_person_usecases": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Compliance/Usa2p/Usecases",
_34
"channel_senders": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelSenders"
_34
},
_34
"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_34
}


Fetch a Service resource

GET https://messaging.twilio.com/v1/Services/{Sid}

Path parameters

Property nameTypeRequiredPIIDescription
SidSID<MG>required

The SID of the Service resource to fetch.

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

Fetch a Service

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function fetchService() {
_18
const service = await client.messaging.v1
_18
.services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18
.fetch();
_18
_18
console.log(service.sid);
_18
}
_18
_18
fetchService();

Output

_39
{
_39
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_39
"sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_39
"date_created": "2015-07-30T20:12:31Z",
_39
"date_updated": "2015-07-30T20:12:33Z",
_39
"friendly_name": "My Service!",
_39
"inbound_request_url": "https://www.example.com/",
_39
"inbound_method": "POST",
_39
"fallback_url": null,
_39
"fallback_method": "POST",
_39
"status_callback": "https://www.example.com",
_39
"sticky_sender": true,
_39
"mms_converter": true,
_39
"smart_encoding": false,
_39
"fallback_to_long_code": true,
_39
"area_code_geomatch": true,
_39
"validity_period": 600,
_39
"scan_message_content": "inherit",
_39
"synchronous_validation": true,
_39
"usecase": "marketing",
_39
"us_app_to_person_registered": false,
_39
"use_inbound_webhook_on_number": true,
_39
"sending_windows": [
_39
{
_39
"start_time": "10:00",
_39
"end_time": "21:00"
_39
}
_39
],
_39
"links": {
_39
"phone_numbers": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers",
_39
"short_codes": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes",
_39
"alpha_senders": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders",
_39
"messages": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages",
_39
"us_app_to_person": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Compliance/Usa2p",
_39
"us_app_to_person_usecases": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Compliance/Usa2p/Usecases",
_39
"channel_senders": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelSenders"
_39
},
_39
"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_39
}


Read multiple Service resources

GET https://messaging.twilio.com/v1/Services

Query parameters

Property nameTypeRequiredPIIDescription
PageSizeintegerOptional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

PageintegerOptional

The page index. This value is simply for client state.

Minimum: 0

PageTokenstringOptional

The page token. This is provided by the API.

List multiple Services

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_16
// Download the helper library from https://www.twilio.com/docs/node/install
_16
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_16
_16
// Find your Account SID and Auth Token at twilio.com/console
_16
// and set the environment variables. See http://twil.io/secure
_16
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16
const authToken = process.env.TWILIO_AUTH_TOKEN;
_16
const client = twilio(accountSid, authToken);
_16
_16
async function listService() {
_16
const services = await client.messaging.v1.services.list({ limit: 20 });
_16
_16
services.forEach((s) => console.log(s.sid));
_16
}
_16
_16
listService();

Output

_52
{
_52
"meta": {
_52
"page": 0,
_52
"page_size": 20,
_52
"first_page_url": "https://messaging.twilio.com/v1/Services?PageSize=20&Page=0",
_52
"previous_page_url": null,
_52
"next_page_url": null,
_52
"key": "services",
_52
"url": "https://messaging.twilio.com/v1/Services?PageSize=20&Page=0"
_52
},
_52
"services": [
_52
{
_52
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_52
"friendly_name": "My Service!",
_52
"sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_52
"date_created": "2015-07-30T20:12:31Z",
_52
"date_updated": "2015-07-30T20:12:33Z",
_52
"sticky_sender": true,
_52
"mms_converter": true,
_52
"smart_encoding": false,
_52
"fallback_to_long_code": true,
_52
"area_code_geomatch": true,
_52
"validity_period": 600,
_52
"scan_message_content": "inherit",
_52
"synchronous_validation": true,
_52
"inbound_request_url": "https://www.example.com/",
_52
"inbound_method": "POST",
_52
"fallback_url": null,
_52
"fallback_method": "POST",
_52
"status_callback": "https://www.example.com",
_52
"usecase": "marketing",
_52
"us_app_to_person_registered": false,
_52
"use_inbound_webhook_on_number": false,
_52
"sending_windows": [
_52
{
_52
"start_time": "10:00",
_52
"end_time": "21:00"
_52
}
_52
],
_52
"links": {
_52
"phone_numbers": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers",
_52
"short_codes": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes",
_52
"alpha_senders": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders",
_52
"messages": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages",
_52
"us_app_to_person": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Compliance/Usa2p",
_52
"us_app_to_person_usecases": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Compliance/Usa2p/Usecases",
_52
"channel_senders": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelSenders"
_52
},
_52
"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_52
}
_52
]
_52
}


Update a Service resource

POST https://messaging.twilio.com/v1/Services/{Sid}

You may specify one or more of the optional parameters above to update the Service's respective properties. Parameters not specified in your request are not updated.

Path parameters

Property nameTypeRequiredPIIDescription
SidSID<MG>required

The SID of the Service resource to update.

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

Request body parameters

Property nameTypeRequiredPIIDescription
FriendlyNamestringOptional

A descriptive string that you create to describe the resource. It can be up to 64 characters long.


InboundRequestUrlstring<uri>Optional

The URL we call using inbound_method when a message is received by any phone number or short code in the Service. When this property is null, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the use_inbound_webhook_on_number field is enabled then the webhook url defined on the phone number will override the inbound_request_url defined for the Messaging Service.


InboundMethodenum<http-method>Optional

The HTTP method we should use to call inbound_request_url. Can be GET or POST and the default is POST.

Possible values:
GETPOST

FallbackUrlstring<uri>Optional

The URL that we call using fallback_method if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the use_inbound_webhook_on_number field is enabled then the webhook url defined on the phone number will override the fallback_url defined for the Messaging Service.


FallbackMethodenum<http-method>Optional

The HTTP method we should use to call fallback_url. Can be: GET or POST.

Possible values:
GETPOST

StatusCallbackstring<uri>Optional

The URL we should call to pass status updates about message delivery.


StickySenderbooleanOptional

Whether to enable Sticky Sender on the Service instance.


MmsConverterbooleanOptional

Whether to enable the MMS Converter for messages sent through the Service instance.


SmartEncodingbooleanOptional

Whether to enable Smart Encoding for messages sent through the Service instance.


ScanMessageContentenum<string>Optional

Reserved.

Possible values:
inheritenabledisable

FallbackToLongCodebooleanOptional

[OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures.


AreaCodeGeomatchbooleanOptional

Whether to enable Area Code Geomatch on the Service Instance.


ValidityPeriodintegerOptional

How long, in seconds, messages sent from the Service are valid. Can be an integer from 1 to 14,400.


SynchronousValidationbooleanOptional

Reserved.


UsecasestringOptional

A string that describes the scenario in which the Messaging Service will be used. Possible values are notifications, marketing, verification, discussion, poll, undeclared.


UseInboundWebhookOnNumberbooleanOptional

A boolean value that indicates either the webhook url configured on the phone number will be used or inbound_request_url/fallback_url url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the inbound_request_url/fallback_url defined for the Messaging Service.

Update a Service

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function updateService() {
_18
const service = await client.messaging.v1
_18
.services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18
.update({ friendlyName: "FriendlyName" });
_18
_18
console.log(service.sid);
_18
}
_18
_18
updateService();

Output

_34
{
_34
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_34
"friendly_name": "FriendlyName",
_34
"sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_34
"date_created": "2015-07-30T20:12:31Z",
_34
"date_updated": "2015-07-30T20:12:33Z",
_34
"sticky_sender": false,
_34
"mms_converter": true,
_34
"smart_encoding": false,
_34
"fallback_to_long_code": true,
_34
"scan_message_content": "inherit",
_34
"synchronous_validation": true,
_34
"area_code_geomatch": true,
_34
"validity_period": 600,
_34
"inbound_request_url": "https://www.example.com",
_34
"inbound_method": "POST",
_34
"fallback_url": null,
_34
"fallback_method": "POST",
_34
"status_callback": "https://www.example.com",
_34
"usecase": "marketing",
_34
"us_app_to_person_registered": false,
_34
"use_inbound_webhook_on_number": true,
_34
"sending_windows": [],
_34
"links": {
_34
"phone_numbers": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers",
_34
"short_codes": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes",
_34
"alpha_senders": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders",
_34
"messages": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages",
_34
"us_app_to_person": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Compliance/Usa2p",
_34
"us_app_to_person_usecases": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Compliance/Usa2p/Usecases",
_34
"channel_senders": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ChannelSenders"
_34
},
_34
"url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_34
}


Delete a Service resource

DELETE https://messaging.twilio.com/v1/Services/{Sid}

When a Service is deleted, all phone numbers and short codes in the Service are returned to your Account.

(warning)

Warning

If you are using a Messaging Service for A2P 10DLC, you should not delete the Messaging Service. Doing so deletes the A2P 10DLC Campaign, which immediately halts all US A2P 10DLC messaging. A new Campaign and Messaging Service must be created and re-registered. This process can take several days.

Path parameters

Property nameTypeRequiredPIIDescription
SidSID<MG>required

The SID of the Service resource to delete.

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

Delete a Service

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_16
// Download the helper library from https://www.twilio.com/docs/node/install
_16
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_16
_16
// Find your Account SID and Auth Token at twilio.com/console
_16
// and set the environment variables. See http://twil.io/secure
_16
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16
const authToken = process.env.TWILIO_AUTH_TOKEN;
_16
const client = twilio(accountSid, authToken);
_16
_16
async function deleteService() {
_16
await client.messaging.v1
_16
.services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_16
.remove();
_16
}
_16
_16
deleteService();


Rate this page: