Sync Webhooks

When creating a service instance, a user can register a webhook URL. This URL will be called for any of the events generated by the client SDK (but not currently for the REST API).

Common Request Parameters

The incoming request for all events will contain the following common parameters:

Parameter Description
AccountSid Your Twilio account id. It is 34 characters long, and always starts with the letters AC.
EndpointId The server-assigned EndpointId for the Sync client that generated the event.
EventType An id specifying the event that was generated (e.g. document_created). See below for a complete list.
Identity The username/identity of the user that generated the event.
ServiceSid The unique id for the service instance.

Document Events

  • document_created: A new document has been created.
  • document_updated: Existing document has been updated.
  • document_removed: Document has been deleted.

Document Event Request Parameters

Parameter Description
DocumentData The data for the document as JSON. Not included for the document_removed event.
DocumentRevision An integer representing the revision of the document.
DocumentSid The document id. It is 34 characters long, and always starts with the letters ET.
DocumentUniqueName The unique name of the document.

List Events

  • list_created: A new list collection has been created.
  • list_removed: List collection has been deleted entirely.

List Event Request Parameters

Parameter Description
ListRevision An integer representing the revision of the list.
ListSid The list id. It is 34 characters long, and always starts with the letters ES.
ListUniqueName The unique name of the list.

List Item Events

  • list_item_added: A new item has been added to existing list collection.
  • list_item_updated: Existing item has been updated in the list collection.
  • list_item_removed: Item has been removed from the list collection.

List Item Event Request Parameters

Parameter Description
EventId A sequence number representing the order of occurrence for the list item event.
ItemData The data for the list item as JSON. Not included for the list_item_removed event.
ItemIndex The index of the item in the list that was added, updated, or removed.
ItemRevision An integer representing the revision of the list item. Not included for the list_item_removed event.
ListRevision An integer representing the revision of the list.
ListSid The list id. It is 34 characters long, and always starts with the letters ES.
ListUniqueName The unique name of the list.

Map Events

  • map_created: A new map collection has been created.
  • map_removed: Map collection has been deleted entirely.

Map Event Request Parameters

Parameter Description
MapRevision An integer representing the revision of the map.
MapSid The map id. It is 34 characters long, and always starts with the letters MP.
MapUniqueName The unique name of the map.

Map Item Events

  • map_item_added: A new item has been added to existing map collection.
  • map_item_updated: Existing item has been updated in the map collection.
  • map_item_removed: Item has been removed from the map collection.

Map Item Event Request Parameters

Parameter Description
EventId A sequence number representing the order of occurrence for the map item event.
ItemData The data for the map item as JSON. Not included for the map_item_removed event.
ItemKey The key of the item in the map that was added, updated, or removed.
ItemRevision An integer representing the revision of the map item. Not included for the map_item_removed event.
MapRevision An integer representing the revision of the map.
MapSid The map id. It is 34 characters long, and always starts with the letters MP.
MapUniqueName The unique name of the map.

Reachability Events

  • endpoint_connected: A new client endpoint has connected to Sync. This event takes place whenever an application running Sync iOS, Android or JS SDK establishes a live persistent connection with Sync service with a valid authentication token.
  • endpoint_disconnected: An online client endpoint has been disconnected from Sync. This event may take place for a number of different reasons:
    • Application running Sync iOS, Android or JS SDK was shut down gracefully or was switched to background mode.
    • Application lost connectivity to Internet, and service dropped an unresponsive connection eventually.
    • First person authentication token expired and was not refreshed timely.
    • Twilio gateway services have received a software update or got rebalanced.

Note: during its Beta phase, Sync is rebalancing connections every hour, which also triggers the endpoint_disconnected -> endpoint_connected cycle as a side effect. All SDKs will automatically re-establish connectivity after rebalancing and replay any missed events, thus applications should not notice any impact of such behavior. In the future, we are planning to relax or remove the rebalancing constraint.

Reachability Event Request Parameters

Parameter Description
EventId A sequence number (positive integer) representing the actual order of reachability events. A larger event ID means a more recent event, within the scope of one identity.

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.