Service Resource
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:
https://messaging.twilio.com/v1
Service properties
Resource Properties in REST API format | |
---|---|
sid
|
The unique string that we created to identify the Service resource. |
account_sid
|
The SID of the Account that created the Service resource. |
friendly_name
|
The string that you assigned to describe the resource. |
date_created
|
The date and time in GMT when the resource was created specified in ISO 8601 format. |
date_updated
|
The date and time in GMT when the resource was last updated specified in ISO 8601 format. |
inbound_request_url
|
The URL we call using |
inbound_method
|
The HTTP method we use to call |
fallback_url
|
The URL that we call using |
fallback_method
|
The HTTP method we use to call |
status_callback
|
The URL we call to pass status updates about message delivery. |
sticky_sender
|
Whether to enable Sticky Sender on the Service instance. |
mms_converter
|
Whether to enable the MMS Converter for messages sent through the Service instance. |
smart_encoding
|
Whether to enable Smart Encoding for messages sent through the Service instance. |
scan_message_content
|
Reserved. |
area_code_geomatch
|
Whether to enable Area Code Geomatch on the Service Instance. |
synchronous_validation
|
Reserved. |
validity_period
|
How long, in seconds, messages sent from the Service are valid. Can be an integer from |
url
|
The absolute URL of the Service resource. |
links
|
The absolute URLs of related resources. |
usecase
|
A string that describes the scenario in which the Messaging Service will be used. Possible values are |
us_app_to_person_registered
|
Whether US A2P campaign is registered for this Service. |
use_inbound_webhook_on_number
|
A boolean value that indicates either the webhook url configured on the phone number will be used or |
Create a Service resource
https://messaging.twilio.com/v1/Services
Parameters
Parameters in REST API format | |
---|---|
friendly_name
Required
|
A descriptive string that you create to describe the resource. It can be up to 64 characters long. |
inbound_request_url
Optional
|
The URL we call using |
inbound_method
Optional
|
The HTTP method we should use to call |
fallback_url
Optional
|
The URL that we call using |
fallback_method
Optional
|
The HTTP method we should use to call |
status_callback
Optional
|
The URL we should call to pass status updates about message delivery. |
sticky_sender
Optional
|
Whether to enable Sticky Sender on the Service instance. |
mms_converter
Optional
|
Whether to enable the MMS Converter for messages sent through the Service instance. |
smart_encoding
Optional
|
Whether to enable Smart Encoding for messages sent through the Service instance. |
scan_message_content
Optional
|
Reserved. |
area_code_geomatch
Optional
|
Whether to enable Area Code Geomatch on the Service Instance. |
validity_period
Optional
|
How long, in seconds, messages sent from the Service are valid. Can be an integer from |
synchronous_validation
Optional
|
Reserved. |
usecase
Optional
|
A string that describes the scenario in which the Messaging Service will be used. Possible values are |
use_inbound_webhook_on_number
Optional
|
A boolean value that indicates either the webhook url configured on the phone number will be used or |
Example 1
Fetch a Service resource
https://messaging.twilio.com/v1/Services/{Sid}
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
The SID of the Service resource to fetch. |
Example 1
Read multiple Service resources
https://messaging.twilio.com/v1/Services
Example 1
Update a Service resource
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.
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
The SID of the Service resource to update. |
friendly_name
Optional
|
A descriptive string that you create to describe the resource. It can be up to 64 characters long. |
inbound_request_url
Optional
|
The URL we call using |
inbound_method
Optional
|
The HTTP method we should use to call |
fallback_url
Optional
|
The URL that we call using |
fallback_method
Optional
|
The HTTP method we should use to call |
status_callback
Optional
|
The URL we should call to pass status updates about message delivery. |
sticky_sender
Optional
|
Whether to enable Sticky Sender on the Service instance. |
mms_converter
Optional
|
Whether to enable the MMS Converter for messages sent through the Service instance. |
smart_encoding
Optional
|
Whether to enable Smart Encoding for messages sent through the Service instance. |
scan_message_content
Optional
|
Reserved. |
area_code_geomatch
Optional
|
Whether to enable Area Code Geomatch on the Service Instance. |
validity_period
Optional
|
How long, in seconds, messages sent from the Service are valid. Can be an integer from |
synchronous_validation
Optional
|
Reserved. |
usecase
Optional
|
A string that describes the scenario in which the Messaging Service will be used. Possible values are |
use_inbound_webhook_on_number
Optional
|
A boolean value that indicates either the webhook url configured on the phone number will be used or |
Example 1
Delete a Service resource
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.
NOTE: One specific use for Messaging Services is to associate them with A2P Campaigns, which is the new protocol for sending automated SMS messages via 10DLC Senders within the United States. If you are using a Messaging Service for this use case, it is important to understand that once your Campaign has been approved by the A2P ecosystem, you should NOT subsequently delete the associated Messaging Service as this will also delete the Campaign itself, which will immediately de-register any 10DLC senders in that MS and thus halt their ability to message within the U.S., until a new Campaign can be registered using those same 10DLC numbers.
This warning applies ONLY to the US A2P 10DLC use case. It does not apply to Messaging Services used for messaging outsider of the U.S., or to Messaging Services using Toll Free numbers, short codes or WhatsApp senders. To learn more about A2P US 10DLC registration, please see this guide.
Twilio is working on making A2P registration a more straightforward user experience moving forward.
Parameters
Parameters in REST API format | |
---|---|
sid
Path
|
The SID of the Service resource to delete. |
Example 1
Need some help?
We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.