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. |
fallback_to_long_code
|
Whether to enable Fallback to Long Code for messages sent through the Service instance. |
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. Examples: [notification, marketing, verification, poll ..] |
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. |
fallback_to_long_code
Optional
|
Whether to enable Fallback to Long Code for messages sent through the Service instance. |
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. Examples: [notification, marketing, verification, poll ..]. |
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. |
fallback_to_long_code
Optional
|
Whether to enable Fallback to Long Code for messages sent through the Service instance. |
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. Examples: [notification, marketing, verification, poll ..] |
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.
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.