Menu

Expand
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

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

accountSid
sid<AC> Not PII

The SID of the Account that created the Service resource.

friendlyName
string Not PII

The string that you assigned to describe the resource.

dateCreated
date_time<iso8601> Not PII

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

dateUpdated
date_time<iso8601> Not PII

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

inboundRequestUrl
url Not PII

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.

inboundMethod
http_method Not PII

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

fallbackUrl
url Not PII

The URL that we call using fallback_method if an error occurs while retrieving or executing the TwiML from the Inbound Request URL.

fallbackMethod
http_method Not PII

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

statusCallback
url Not PII

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

stickySender
boolean Not PII

Whether to enable Sticky Sender on the Service instance.

mmsConverter
boolean Not PII

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

smartEncoding
boolean Not PII

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

scanMessageContent
enum:scan_message_content Not PII

Reserved.

fallbackToLongCode
boolean Not PII

Whether to enable Fallback to Long Code for messages sent through the Service instance.

areaCodeGeomatch
boolean Not PII

Whether to enable Area Code Geomatch on the Service Instance.

synchronousValidation
boolean Not PII

Reserved.

validityPeriod
integer Not PII

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

url
url Not PII

The absolute URL of the Service resource.

links
uri_map Not PII

The absolute URLs of related resources.

Create a Service resource

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

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

inbound_request_url
Optional
post url Not PII

The URL we should 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.

inbound_method
Optional
post http_method Not PII

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

fallback_url
Optional
post url Not PII

The URL that we should call using fallback_method if an error occurs while retrieving or executing the TwiML from the Inbound Request URL.

fallback_method
Optional
post http_method Not PII

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

status_callback
Optional
post url Not PII

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

sticky_sender
Optional
post boolean Not PII

Whether to enable Sticky Sender on the Service instance.

mms_converter
Optional
post boolean Not PII

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

smart_encoding
Optional
post boolean Not PII

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

scan_message_content
Optional
post enum:scan_message_content Not PII

Reserved.

fallback_to_long_code
Optional
post boolean Not PII

Whether to enable Fallback to Long Code for messages sent through the Service instance.

area_code_geomatch
Optional
post boolean Not PII

Whether to enable Area Code Geomatch on the Service Instance.

validity_period
Optional
post integer Not PII

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

synchronous_validation
Optional
post boolean Not PII

Reserved.

Example
        
        
        
        

        Fetch a Service resource

        get
        https://messaging.twilio.com/v1/Services/{Sid}
        Parameters
        Names in None format
        sid
        Required
        get sid<MG> Not PII

        The SID of the Service resource to fetch.

        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.

                    Parameters
                    Names in None format
                    sid
                    Required
                    post sid<MG> Not PII

                    The SID of the Service resource to update.

                    friendly_name
                    Optional
                    post string Not PII

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

                    inbound_request_url
                    Optional
                    post url Not PII

                    The URL we should 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.

                    inbound_method
                    Optional
                    post http_method Not PII

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

                    fallback_url
                    Optional
                    post url Not PII

                    The URL that we should call using fallback_method if an error occurs while retrieving or executing the TwiML from the Inbound Request URL.

                    fallback_method
                    Optional
                    post http_method Not PII

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

                    status_callback
                    Optional
                    post url Not PII

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

                    sticky_sender
                    Optional
                    post boolean Not PII

                    Whether to enable Sticky Sender on the Service instance.

                    mms_converter
                    Optional
                    post boolean Not PII

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

                    smart_encoding
                    Optional
                    post boolean Not PII

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

                    scan_message_content
                    Optional
                    post enum:scan_message_content Not PII

                    Reserved.

                    fallback_to_long_code
                    Optional
                    post boolean Not PII

                    Whether to enable Fallback to Long Code for messages sent through the Service instance.

                    area_code_geomatch
                    Optional
                    post boolean Not PII

                    Whether to enable Area Code Geomatch on the Service Instance.

                    validity_period
                    Optional
                    post integer Not PII

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

                    synchronous_validation
                    Optional
                    post boolean Not PII

                    Reserved.

                    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.

                          Parameters
                          Names in None format
                          sid
                          Required
                          delete sid<MG> Not PII

                          The SID of the Service resource to delete.

                          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.