Create service

POST /v1/Services

Containers for sync objects

application/x-www-form-urlencoded

Body

  • FriendlyName string

    A string that you assign to describe the resource.

  • WebhookUrl string(uri)

    The URL we should call when Sync objects are manipulated.

  • ReachabilityWebhooksEnabled boolean

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

  • AclEnabled boolean

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

  • ReachabilityDebouncingEnabled boolean

    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.

  • ReachabilityDebouncingWindow integer

    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.

  • WebhooksFromRestEnabled boolean

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

Responses

  • 201 application/json

    Created

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • sid string | null

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

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^IS[0-9a-fA-F]{32}$.

    • unique_name string | null

      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 string | null

      The SID of the Account that created the Service resource.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

    • friendly_name string | null

      The string that you assigned to describe the resource.

    • date_created string(date-time) | null

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

    • date_updated string(date-time) | null

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

    • url string(uri) | null

      The absolute URL of the Service resource.

    • webhook_url string(uri) | null

      The URL we call when Sync objects are manipulated.

    • webhooks_from_rest_enabled boolean | null

      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 | null

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

    • acl_enabled boolean | null

      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 | null

      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

      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.

      Default value is 0.

POST /v1/Services
curl \
 --request POST 'https://sync.twilio.com/v1/Services' \
 --user "username:password" \
 --header "Content-Type: application/x-www-form-urlencoded" \
 --data 'AclEnabled=true&WebhookUrl=http%3A%2F%2Fwww.example.com&FriendlyName=friendly_name&ReachabilityDebouncingWindow=5000'
Request example
{"AclEnabled"=>true, "WebhookUrl"=>"http://www.example.com", "FriendlyName"=>"friendly_name", "ReachabilityDebouncingWindow"=>5000}
Response examples (201)
{
  "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "links": {
    "maps": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps",
    "lists": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists",
    "streams": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams",
    "documents": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents"
  },
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "acl_enabled": true,
  "unique_name": "unique_name",
  "webhook_url": "http://www.example.com",
  "date_created": "2015-07-30T20:00:00Z",
  "date_updated": "2015-07-30T20:00:00Z",
  "friendly_name": "friendly_name",
  "webhooks_from_rest_enabled": false,
  "reachability_webhooks_enabled": false,
  "reachability_debouncing_window": 5000,
  "reachability_debouncing_enabled": false
}