Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now

Menu

Expand
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?

List resource

A Sync List is an ordered collection of individual items, each storing separate JSON objects.

After you create a List, use the ListItem resource to add, retrieve, update, and delete items from your List. See that page for more details on how items are stored in lists, including ordering, expiration, and limitations on each item's size.

List properties

Names in PHP format
sid
sid<ES> Not PII

The unique string that we created to identify the Sync List resource.

uniqueName

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.

accountSid
sid<AC> Not PII

The SID of the Account that created the Sync List resource.

serviceSid
sid<IS> Not PII

The SID of the Sync Service the resource is associated with.

url
url Not PII

The absolute URL of the Sync List resource.

links
uri_map Not PII

The URLs of the Sync List's nested resources.

revision
string Not PII

The current revision of the Sync List, represented as a string.

dateExpires
date_time<iso8601> Not PII

The date and time in GMT when the Sync List expires and will be deleted, specified in ISO 8601 format. If the Sync List does not expire, this value is null. The Sync List might not be deleted immediately after it expires.

dateCreated
date_time<iso8601> Not PII

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

dateUpdated
date_time<iso8601> Not PII

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

createdBy

The identity of the Sync List's creator. If the Sync List is created from the client SDK, the value matches the Access Token's identity field. If the Sync List was created from the REST API, the value is system.

Create a List resource

post
https://sync.twilio.com/v1/Services/{ServiceSid}/Lists
Parameters
Names in None format
service_sid
Required
post sid_like<IS> Not PII

The SID of the Sync Service to create the new Sync List in.

unique_name
Optional
post string PII MTL: 30 DAYS

An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The unique_name value can be used as an alternative to the sid in the URL path to address the resource.

ttl
Optional
post integer Not PII

Alias for collection_ttl. If both are provided, this value is ignored.

collection_ttl
Optional
post integer Not PII

How long, in seconds, before the Sync List expires (time-to-live) and is deleted. Can be an integer from 0 to 31,536,000 (1 year). The default value is 0, which means the Sync List does not expire. The Sync List will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion.

Example
        
        
        
        

        Fetch a List resource

        get
        https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{Sid}
        Parameters
        Names in None format
        service_sid
        Required
        get sid_like<IS> Not PII

        The SID of the Sync Service with the Sync List resource to fetch.

        sid
        Required
        get sid_like<ES> Not PII

        The SID of the Sync List resource to fetch.

        Example
              
              
              
              

              Read a List resource

              get
              https://sync.twilio.com/v1/Services/{ServiceSid}/Lists
              Parameters
              Names in None format
              service_sid
              Required
              get sid_like<IS> Not PII

              The SID of the Sync Service with the Sync List resources to read.

              Example
                    
                    
                    
                    

                    Update a List resource

                    post
                    https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{Sid}
                    Parameters
                    Names in None format
                    service_sid
                    Required
                    post sid_like<IS> Not PII

                    The SID of the Sync Service with the Sync List resource to update.

                    sid
                    Required
                    post sid_like<ES> Not PII

                    The SID of the Sync List resource to update.

                    ttl
                    Optional
                    post integer Not PII

                    An alias for collection_ttl. If both are provided, this value is ignored.

                    collection_ttl
                    Optional
                    post integer Not PII

                    How long, in seconds, before the Sync List expires (time-to-live) and is deleted. Can be an integer from 0 to 31,536,000 (1 year). The default value is 0, which means the Sync List does not expire. The Sync List will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion.

                    Example
                          
                          
                          
                          

                          Delete a List resource

                          delete
                          https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{Sid}

                          Permanently delete a List along with all items belonging to it.

                          Parameters
                          Names in None format
                          service_sid
                          Required
                          delete sid_like<IS> Not PII

                          The SID of the Sync Service with the Sync List resource to delete.

                          sid
                          Required
                          delete sid_like<ES> Not PII

                          The SID of the Sync List resource to delete.

                          Example
                                
                                
                                
                                
                                Rate this page:

                                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.