Menu

Expand
Rate this page:

Service Resource

A Service is the top-level scope of all other resources in the REST API. It contains all the objects in a Sync application. Services allow you to:

  • Create multiple environments (dev, stage, prod) under the same Twilio account with segregated data
  • Scope access to resources through the REST API
  • Configure behavior of those resources in the scope of a Service

Service properties

Resource Properties in REST API format
sid
sid<IS> Not PII

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

unique_name
string Not PII

An application-defined string that uniquely identifies the resource. It can be used in place of the resource's sid in the URL to address the resource. It is a read-only property, it cannot be assigned using REST API.

account_sid
sid<AC> Not PII

The SID of the Account that created the Service resource.

friendly_name

The string that you assigned to describe the resource.

date_created
date_time<iso8601> Not PII

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

date_updated
date_time<iso8601> Not PII

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

url
url Not PII

The absolute URL of the Service resource.

webhook_url
url Not PII

The URL we call when Sync objects are manipulated.

webhooks_from_rest_enabled
boolean Not PII

Whether the Service instance should call webhook_url when the REST API is used to update Sync objects. The default is false.

reachability_webhooks_enabled
boolean Not PII

Whether the service instance calls webhook_url when client endpoints connect to Sync. The default is false.

acl_enabled
boolean Not PII

Whether token identities in the Service must be granted access to Sync objects by using the Permissions resource. It is disabled (false) by default.

reachability_debouncing_enabled
boolean Not PII

Whether every endpoint_disconnected event should occur after a configurable delay. The default is false, where the endpoint_disconnected event occurs immediately after disconnection. When true, intervening reconnections can prevent the endpoint_disconnected event.

reachability_debouncing_window
integer Not PII

The reachability event delay in milliseconds if reachability_debouncing_enabled = true. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before webhook_url is called, if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the reachability event from occurring.

links
uri_map Not PII

The URLs of related resources.

Create a Service resource

post
https://sync.twilio.com/v1/Services
Parameters
Parameters in REST API format
friendly_name
Optional
post string PII MTL: 7 DAYS

A string that you assign to describe the resource.

webhook_url
Optional
post url Not PII

The URL we should call when Sync objects are manipulated.

reachability_webhooks_enabled
Optional
post boolean Not PII

Whether the service instance should call webhook_url when client endpoints connect to Sync. The default is false.

acl_enabled
Optional
post boolean Not PII

Whether token identities in the Service must be granted access to Sync objects by using the Permissions resource.

reachability_debouncing_enabled
Optional
post boolean Not PII

Whether every endpoint_disconnected event should occur after a configurable delay. The default is false, where the endpoint_disconnected event occurs immediately after disconnection. When true, intervening reconnections can prevent the endpoint_disconnected event.

reachability_debouncing_window
Optional
post integer Not PII

The reachability event delay in milliseconds if reachability_debouncing_enabled = true. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the webhook_url is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the call to webhook_url.

webhooks_from_rest_enabled
Optional
post boolean Not PII

Whether the Service instance should call webhook_url when the REST API is used to update Sync objects. The default is false.

Example 1
Loading Code Sample...
        
        

        Create Service resource

        Example 2
        Loading Code Sample...
              
              

              Create Service resource with a webhook URL

              Fetch a Service resource

              get
              https://sync.twilio.com/v1/Services/{Sid}
              Parameters
              Parameters in REST API format
              sid
              Path
              get sid_like<IS> Not PII

              The SID of the Service resource to fetch.

              Example 1
              Loading Code Sample...
                    
                    

                    Fetch Service

                    Read multiple Service resources

                    get
                    https://sync.twilio.com/v1/Services
                    Example 1
                    Loading Code Sample...
                          
                          

                          Read Service

                          Update a Service resource

                          post
                          https://sync.twilio.com/v1/Services/{Sid}
                          Parameters
                          Parameters in REST API format
                          sid
                          Path
                          post sid_like<IS> Not PII

                          The SID of the Service resource to update.

                          webhook_url
                          Optional
                          post url Not PII

                          The URL we should call when Sync objects are manipulated.

                          friendly_name
                          Optional
                          post string PII MTL: 7 DAYS

                          A string that you assign to describe the resource.

                          reachability_webhooks_enabled
                          Optional
                          post boolean Not PII

                          Whether the service instance should call webhook_url when client endpoints connect to Sync. The default is false.

                          acl_enabled
                          Optional
                          post boolean Not PII

                          Whether token identities in the Service must be granted access to Sync objects by using the Permissions resource.

                          reachability_debouncing_enabled
                          Optional
                          post boolean Not PII

                          Whether every endpoint_disconnected event should occur after a configurable delay. The default is false, where the endpoint_disconnected event occurs immediately after disconnection. When true, intervening reconnections can prevent the endpoint_disconnected event.

                          reachability_debouncing_window
                          Optional
                          post integer Not PII

                          The reachability event delay in milliseconds if reachability_debouncing_enabled = true. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the webhook is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the webhook from being called.

                          webhooks_from_rest_enabled
                          Optional
                          post boolean Not PII

                          Whether the Service instance should call webhook_url when the REST API is used to update Sync objects. The default is false.

                          Example 1
                          Loading Code Sample...
                                
                                

                                Update Service

                                Delete a Service resource

                                delete
                                https://sync.twilio.com/v1/Services/{Sid}
                                Parameters
                                Parameters in REST API format
                                sid
                                Path
                                delete sid_like<IS> Not PII

                                The SID of the Service resource to delete.

                                Example 1
                                Loading Code Sample...
                                      
                                      

                                      Delete Service

                                      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 by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

                                      Loading Code Sample...
                                            
                                            
                                            

                                            Thank you for your feedback!

                                            Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                                            Sending your feedback...
                                            🎉 Thank you for your feedback!
                                            Something went wrong. Please try again.

                                            Thanks for your feedback!

                                            thanks-feedback-gif