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?

Services Resource

A Service is the top-level scope of all other resources in the Programmable Chat REST API. It owns Channels, Users, Messages, Credentials, and all other data for a Chat implementation. Services allow the developer to:

  • Create multiple environments (dev, stage, prod) under the same Twilio account with segregated data
  • Scope access to resources through both the REST and client APIs
  • Configure various behaviors of the service per instance

A Service will also send HTTPS requests to URLs configured by the developer when interesting events happen. Check out the webhook reference to see what events you can subscribe to in your Service.

Twilio Console

You can manage your Programmable Chat Services using your Twilio console when logged in to the console.

Properties

Each service has these properties:

Names in Java format
sid
sid<IS> Not PII

A 34 character string that uniquely identifies this resource.

accountSid
sid<AC> Not PII

The unique id of the Account responsible for this service.

friendlyName

The human-readable name of this service.

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

defaultServiceRoleSid
sid<RL> Not PII

The service role assigned to users when they are added to the service. See the Roles endpoint for more details.

defaultChannelRoleSid
sid<RL> Not PII

The channel role assigned to users when they are added to a channel. See the Roles endpoint for more details.

defaultChannelCreatorRoleSid
sid<RL> Not PII

The channel role assigned to a channel creator when joining a new channel. See the Roles endpoint for more details.

readStatusEnabled
boolean Not PII

Enable the Message Consumption Horizon feature (true if enabled, false if not). Defaults to true.

reachabilityEnabled
boolean Not PII

Indicates whether the the Reachability feature is enabled for this Service instance. Defaults to false.

typingIndicatorTimeout
integer Not PII

The amount of time in seconds after a "started typing" event when clients should assume that user is no longer typing, even if no "ended typing" message was received. Default is 5 seconds.

consumptionReportInterval
integer Not PII

DEPRECATED. Value will default to 1 second. The interval in seconds between consumption reports submission batches from client endpoints. Default is 10 seconds.

limits
object Not PII

Configuration for service instance level limits. Configurable limits are Max Channels per User (default: 250; maximum allowed: 1,000) and Max Members per Channel (default: 100; maximum allowed: 1,000).

preWebhookUrl
string Not PII

The webhook URL for PRE-Event webhooks. See Webhook Events for more details.

postWebhookUrl
string Not PII

The webhook URL for POST-Event webhooks. See Webhook Events for more details.

webhookMethod
string Not PII

The webhook request format to use for both PRE and POST webhooks. Must be POST or GET. See Webhook Events for more details. The default is POST.

webhookFilters
string[] Not PII

The list of WebHook events that are enabled for this Service instance. See Webhook Events for more details.

preWebhookRetryCount
integer Not PII

Count of times webhook will be retried in case of timeout (5 seconds) or 429/503/504 HTTP responses. Default retry count is 0 times.

postWebhookRetryCount
integer Not PII

Count of times webhook will be retried in case of timeout (5 seconds) or 429/503/504 HTTP responses. Default retry count is 0 times.

notifications
object Not PII

Notification configuration for the Service instance. See Push Notification Configuration for more information.

media
object Not PII

url
url Not PII

An absolute URL for this service.

links
uri_map Not PII

URLs to access the Channels, Roles, and Users for this service.

List All Services

GET /Services
        
        
        
        

        Create A Service

        POST /Services
        

        Parameters

        Names in Java format
        friendlyName
        Required
        post string PII MTL: 120 DAYS

        Human-readable name for this service instance

              
              
              
              

              Retrieve a Service

              GET /Services/{Service SID}
              
                    
                    
                    
                    

                    Update A Service

                    POST /Services/{Service SID}
                    

                    Parameters

                    Names in Java format
                    friendlyName
                    Optional
                    post string PII MTL: 120 DAYS

                    Human-readable name for this service instance

                    defaultChannelRoleSid
                    Optional
                    post sid<RL> Not PII

                    Channel role assigned on channel join (see Roles data model for the details)

                    defaultChannelCreatorRoleSid
                    Optional
                    post sid<RL> Not PII

                    Channel role assigned to creator of channel when joining for first time

                    readStatusEnabled
                    Optional
                    post boolean Not PII

                    true if the member read status feature is enabled, false if not. Defaults to true.

                    reachabilityEnabled
                    Optional
                    post boolean Not PII

                    true if the reachability feature should be enabled. Defaults to false

                    typingIndicatorTimeout
                    Optional
                    post integer Not PII

                    The duration in seconds indicating the timeout after "started typing" event when client should assume that user is not typing anymore even if no "ended typing" message received

                    preWebhookUrl
                    Optional
                    post url Not PII

                    The webhook URL for PRE-Event webhooks. See Webhook Events for more details.

                    postWebhookUrl
                    Optional
                    post url Not PII

                    The webhook URL for POST-Event webhooks. See Webhook Events for more details.

                    webhookMethod
                    Optional
                    post http_method Not PII

                    The webhook request format to use. Must be POST or GET. See Webhook Events for more details.

                    webhookFilters
                    Optional
                    post string[] Not PII

                    The list of WebHook events that are enabled for this Service instance. See Webhook Events for more details.

                    limitsChannelMembers
                    Optional
                    post integer Not PII

                    The maximum number of Members that can be added to Channels within this Service. The maximum allowed value is 1,000

                    limitsUserChannels
                    Optional
                    post integer Not PII

                    The maximum number of Channels Users can be a Member of within this Service. The maximum value allowed is 1,000

                    preWebhookRetryCount
                    Optional
                    post integer Not PII

                    Count of times webhook will be retried in case of timeout (5 seconds) or 429/503/504 HTTP responses. Default retry count is 0 times.

                    postWebhookRetryCount
                    Optional
                    post integer Not PII

                    Count of times webhook will be retried in case of timeout (5 seconds) or 429/503/504 HTTP responses. Default retry count is 0 times.

                          
                          
                          
                          

                          Delete A Service

                          DELETE /Services/{Service SID}
                          
                                
                                
                                
                                

                                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.