Menu

Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Service Resource

Public Beta
Twilio's Messaging Services API is currently available as a Public Beta product. Some features are not yet implemented and others may be changed before the product is declared as Generally Available.
Public Beta products are not covered by a Twilio SLA.

When messages are sent using a Messaging Service, enabled Copilot features assist to improve message performance.

Developers can associate phone numbers, short codes, and alpha sender IDs to an instance of a Messaging Service. All inbound and outbound behaviors for the phone numbers and shortcodes are handled by the configuration of the Service.

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

Names in PHP format
sid
sid<MG> Not PII

Unique 34 character ID of the Service.

accountSid
sid<AC> Not PII

Unique 34 character ID of the Account that created this Service.

friendlyName
string Not PII

A human readable descriptive text for this resource, up to 64 characters.

dateCreated
date_time<iso8601> Not PII

The date that this resource was created.

dateUpdated
date_time<iso8601> Not PII

The date that this resource was last updated.

inboundRequestUrl
url Not PII

The URL Twilio will make a webhook request to when a message is received by any phone number or short code in your Service. When this property is null receiving inbound messages is disabled. All messages sent to your Twilio phone number or short code will not be logged and received on your Account.

inboundMethod
http_method Not PII

The HTTP method Twilio will use when making requests to the Inbound Request URL. Possible values are GET or POST.

fallbackUrl
url Not PII

The URL that Twilio will request if an error occurs when retrieving or executing the TwiML from your Inbound Request URL.

fallbackMethod
http_method Not PII

The HTTP method Twilio will use when making requests to the Fallback URL. Possible values include GET or POST.

statusCallback
url Not PII

The URL Twilio will make a webhook request to when passing you status updates about the delivery of your messages.

stickySender
boolean Not PII

Configuration to enable or disable Sticky Sender on your Service instance. Possible values are true and false.

mmsConverter
boolean Not PII

Configuration to enable or disable MMS Converter for messages sent through your Service instance. Possible values are true and false.

smartEncoding
boolean Not PII

Configuration to enable or disable Smart Encoding for messages sent through your Service instance. Possible values are true and false.

scanMessageContent
enum:scan_message_content Not PII

fallbackToLongCode
boolean Not PII

Configuration to enable or disable Fallback to Long Code for messages sent through your Service instance. Possible values are true and false.

areaCodeGeomatch
boolean Not PII

Configuration to enable or disable Area Code Geomatch on your Service Instance. Possible values are true and false.

synchronousValidation
boolean Not PII

validityPeriod
integer Not PII

The number of seconds all messages sent from your Service are valid for. Acceptable integers range from 1 to 14,400.

url
url Not PII

links
uri_map Not PII

Create a Service resource

post
https://messaging.twilio.com/v1/Services
Parameters
Names in None format
friendly_name
Required
post string Not PII

A human readable descriptive text for this resource, up to 64 characters.

inbound_request_url
Optional
post url Not PII

A webhook request is made to the Inbound Request URL when a message is received by any phone number or shortcode associated to your Messaging Service. Set to null to disable inbound messaging.

inbound_method
Optional
post http_method Not PII

The HTTP method used when making requests to the Inbound Request URL. Either GET or POST. Default value is POST.

fallback_url
Optional
post url Not PII

A request is made to the Fallback URL if an error occurs with retrieving or executing the TwiML from you Inbound Request URL.

fallback_method
Optional
post http_method Not PII

The HTTP method used when requesting the Fallback URL. Either GET or POST. Default value is POST.

status_callback
Optional
post url Not PII

A webhook request is made to the Status Callback to pass status updates about your messages. These status updates let you know if your accepted message were successfully sent and delivered or if a delivery related error may have occurred.

sticky_sender
Optional
post boolean Not PII

Configuration to enable or disable Sticky Sender on your Service Instance. Possible values are true and false. Default value is true.

mms_converter
Optional
post boolean Not PII

Configuration to enable or disable MMS Converter on your Service Instance. Possible values are true and false. Default value is true.

smart_encoding
Optional
post boolean Not PII

Configuration to enable or disable Smart Encoding. Possible values are true and false. Default value is true.

fallback_to_long_code
Optional
post boolean Not PII

Configuration to enable or disable Fallback to Long Code. Possible values are true and false. Default value is false.

area_code_geomatch
Optional
post boolean Not PII

Configuration to enable or disable Area Code Geomatch. Possible values are true and false. Default value is false.

validity_period
Optional
post integer Not PII

Configuration to set the validity period of all messages sent from your Service, in seconds. Acceptable integers range from 1 to 14,400. Default value is 14,400.

Example
        
        
        
        

        Fetch a Service resource

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

              Read multiple Service resources

              get
              https://messaging.twilio.com/v1/Services
              Example
                    
                    
                    
                    

                    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.

                    Example
                          
                          
                          
                          

                          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.

                          Example
                                
                                
                                
                                
                                Rate this page:

                                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 browsing the Twilio tag on Stack Overflow.