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:

account_sid
sid<AC> Not PII

The unique id of the Account responsible for this service.

consumption_report_interval
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.

date_created
date_time<iso8601> Not PII

The date that this resource was created

date_updated
date_time<iso8601> Not PII

The date that this resource was last updated

default_channel_creator_role_sid
sid<RL> Not PII

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

default_channel_role_sid
sid<RL> Not PII

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

default_service_role_sid
sid<RL> Not PII

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

friendly_name

The human-readable name of this service.

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).

links
uri_map Not PII

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

notifications
object Not PII

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

post_webhook_retry_count
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.

post_webhook_url
string Not PII

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

pre_webhook_retry_count
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.

pre_webhook_url
string Not PII

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

reachability_enabled
boolean Not PII

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

read_status_enabled
boolean Not PII

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

sid
sid<IS> Not PII

A 34 character string that uniquely identifies this resource.

typing_indicator_timeout
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.

url
url Not PII

An absolute URL for this service.

webhook_filters
string[] Not PII

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

webhook_method
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.

List All Services

GET /Services
Loading Code Sample...
      
      
      
      

      Create A Service

      POST /Services
      

      Parameters

      FriendlyName
      Required
      post string PII MTL: 120 DAYS

      Human-readable name for this service instance

      Loading Code Sample...
          
          
          
          

          Retrieve a Service

          GET /Services/{Service SID}
          
          Loading Code Sample...
              
              
              
              

              Update A Service

              POST /Services/{Service SID}
              

              Parameters

              DefaultChannelCreatorRoleSid
              Optional
              post sid<RL> Not PII

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

              DefaultChannelRoleSid
              Optional
              post sid<RL> Not PII

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

              FriendlyName
              Optional
              post string PII MTL: 120 DAYS

              Human-readable name for this service instance

              Limits.ChannelMembers
              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

              Limits.UserChannels
              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

              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.

              PostWebhookUrl
              Optional
              post url Not PII

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

              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.

              PreWebhookUrl
              Optional
              post url Not PII

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

              ReachabilityEnabled
              Optional
              post boolean Not PII

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

              ReadStatusEnabled
              Optional
              post boolean Not PII

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

              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

              WebhookFilters
              Optional
              post string[] Not PII

              The list of WebHook events that are enabled for this Service instance. 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.

              Loading Code Sample...
                  
                  
                  
                  

                  Delete A Service

                  DELETE /Services/{Service SID}
                  
                  Loading Code Sample...
                      
                      
                      
                      

                      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.

                      Loading Code Sample...