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:
The unique string that we created to identify the Service resource.
^IS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
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.
The SID of the Account that created the Service resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The date and time in GMT when the resource was created specified in ISO 8601 format.
The date and time in GMT when the resource was last updated specified in ISO 8601 format.
Whether the Service instance should call webhook_url
when the REST API is used to update Sync objects. The default is false
.
Whether the service instance calls webhook_url
when client endpoints connect to Sync. The default is false
.
Whether token identities in the Service must be granted access to Sync objects by using the Permissions resource. It is disabled (false) by default.
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.
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.
0
The URLs of related resources.
POST https://sync.twilio.com/v1/Services
application/x-www-form-urlencoded
Whether the service instance should call webhook_url
when client endpoints connect to Sync. The default is false
.
Whether token identities in the Service must be granted access to Sync objects by using the Permissions resource.
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.
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
.
Whether the Service instance should call webhook_url
when the REST API is used to update Sync objects. The default is false
.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createService() {11const service = await client.sync.v1.services.create();1213console.log(service.sid);14}1516createService();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"date_created": "2015-07-30T20:00:00Z",4"date_updated": "2015-07-30T20:00:00Z",5"friendly_name": "friendly_name",6"links": {7"documents": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents",8"lists": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists",9"maps": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps",10"streams": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams"11},12"sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",13"unique_name": "unique_name",14"url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15"webhook_url": "http://www.example.com",16"webhooks_from_rest_enabled": false,17"reachability_webhooks_enabled": false,18"acl_enabled": true,19"reachability_debouncing_enabled": false,20"reachability_debouncing_window": 500021}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createService() {11const service = await client.sync.v1.services.create({12webhookUrl: "https://example.com/sync",13});1415console.log(service.sid);16}1718createService();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"date_created": "2015-07-30T20:00:00Z",4"date_updated": "2015-07-30T20:00:00Z",5"friendly_name": "friendly_name",6"links": {7"documents": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents",8"lists": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists",9"maps": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps",10"streams": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams"11},12"sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",13"unique_name": "unique_name",14"url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15"webhook_url": "https://example.com/sync",16"webhooks_from_rest_enabled": false,17"reachability_webhooks_enabled": false,18"acl_enabled": true,19"reachability_debouncing_enabled": false,20"reachability_debouncing_window": 500021}
GET https://sync.twilio.com/v1/Services/{Sid}
The SID of the Service resource to fetch.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchService() {11const service = await client.sync.v1.services("Sid").fetch();1213console.log(service.sid);14}1516fetchService();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"date_created": "2015-07-30T20:00:00Z",4"date_updated": "2015-07-30T20:00:00Z",5"friendly_name": "friendly_name",6"links": {7"documents": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents",8"lists": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists",9"maps": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps",10"streams": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams"11},12"sid": "Sid",13"unique_name": "unique_name",14"url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15"webhook_url": "http://www.example.com",16"webhooks_from_rest_enabled": false,17"reachability_webhooks_enabled": false,18"acl_enabled": false,19"reachability_debouncing_enabled": false,20"reachability_debouncing_window": 500021}
GET https://sync.twilio.com/v1/Services
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listService() {11const services = await client.sync.v1.services.list({ limit: 20 });1213services.forEach((s) => console.log(s.sid));14}1516listService();
1{2"meta": {3"first_page_url": "https://sync.twilio.com/v1/Services?PageSize=50&Page=0",4"key": "services",5"next_page_url": null,6"page": 0,7"page_size": 50,8"previous_page_url": null,9"url": "https://sync.twilio.com/v1/Services?PageSize=50&Page=0"10},11"services": []12}
POST https://sync.twilio.com/v1/Services/{Sid}
The SID of the Service resource to update.
application/x-www-form-urlencoded
Whether the service instance should call webhook_url
when client endpoints connect to Sync. The default is false
.
Whether token identities in the Service must be granted access to Sync objects by using the Permissions resource.
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.
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.
Whether the Service instance should call webhook_url
when the REST API is used to update Sync objects. The default is false
.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updateService() {11const service = await client.sync.v112.services("Sid")13.update({ webhookUrl: "https://www.example.com" });1415console.log(service.sid);16}1718updateService();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"date_created": "2015-07-30T20:00:00Z",4"date_updated": "2015-07-30T20:00:00Z",5"friendly_name": "friendly_name",6"links": {7"documents": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents",8"lists": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists",9"maps": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps",10"streams": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams"11},12"sid": "Sid",13"unique_name": "unique_name",14"url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",15"webhook_url": "https://www.example.com",16"webhooks_from_rest_enabled": false,17"reachability_webhooks_enabled": false,18"acl_enabled": true,19"reachability_debouncing_enabled": false,20"reachability_debouncing_window": 500021}
DELETE https://sync.twilio.com/v1/Services/{Sid}
The SID of the Service resource to delete.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function deleteService() {11await client.sync.v1.services("Sid").remove();12}1314deleteService();