# ListItem resource

A Sync **ListItem** is an object you have added to a [Sync List](/docs/sync/api/list-resource).

> \[!NOTE]
>
> You need to [create a List](/docs/sync/api/list-resource) *before* you can use
> this resource to create, read, update, and delete items within it.

Sync Lists generally behave like arrays in most programming languages. However, when working with ListItems, keep these details in mind:

* Items can be appended, updated, removed and iterated, but not inserted at random position.
* Each item is limited to 16KB of data.
* Item read or update access is performed using an item index that is internally generated.
* The index is not guaranteed to be contiguous.
* Full list modification history is maintained with every change triggering new revision.
* Strict ordering of all list mutation events and all contained items is guaranteed.
* Lists expire and are deleted automatically, if you included a TTL parameter when creating your List. By default, a List and its items are persisted permanently.

## ListItem properties

```json
{"type":"object","refName":"sync.v1.service.sync_list.sync_list_item","modelName":"sync_v1_service_sync_list_sync_list_item","properties":{"index":{"type":"integer","default":0,"description":"The automatically generated index of the List Item. The `index` values of the List Items in a Sync List can have gaps in their sequence."},"account_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^AC[0-9a-fA-F]{32}$","nullable":true,"description":"The SID of the [Account](/docs/iam/api/account) that created the List Item resource."},"service_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^IS[0-9a-fA-F]{32}$","nullable":true,"description":"The SID of the [Sync Service](/docs/sync/api/service) the resource is associated with."},"list_sid":{"type":"string","minLength":34,"maxLength":34,"pattern":"^ES[0-9a-fA-F]{32}$","nullable":true,"description":"The SID of the Sync List that contains the List Item."},"url":{"type":"string","format":"uri","nullable":true,"description":"The absolute URL of the List Item resource."},"revision":{"type":"string","nullable":true,"description":"The current revision of the item, represented as a string."},"data":{"nullable":true,"description":"An arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length.","x-twilio":{"pii":{"handling":"sensitive","deleteSla":7}}},"date_expires":{"type":"string","format":"date-time","nullable":true,"description":"The date and time in GMT when the List Item expires and will be deleted, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. If the List Item does not expire, this value is `null`. The List Item resource might not be deleted immediately after it expires."},"date_created":{"type":"string","format":"date-time","nullable":true,"description":"The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format."},"date_updated":{"type":"string","format":"date-time","nullable":true,"description":"The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format."},"created_by":{"type":"string","nullable":true,"description":"The identity of the List Item's creator. If the item is created from the client SDK, the value matches the Access Token's `identity` field. If the item was created from the REST API, the value is `system`.","x-twilio":{"pii":{"handling":"standard","deleteSla":30}}}}}
```

## Create a ListItem resource

`POST https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{ListSid}/Items`

### Path parameters

```json
[{"name":"ServiceSid","in":"path","description":"The SID of the [Sync Service](/docs/sync/api/service) to create the new List Item in.","schema":{"type":"string"},"required":true},{"name":"ListSid","in":"path","description":"The SID of the Sync List to add the new List Item to. Can be the Sync List resource's `sid` or its `unique_name`.","schema":{"type":"string"},"required":true}]
```

### Request body parameters

```json
{"schema":{"type":"object","title":"CreateSyncListItemRequest","required":["Data"],"properties":{"Data":{"description":"A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length.","x-twilio":{"pii":{"handling":"sensitive","deleteSla":7}}},"Ttl":{"type":"integer","description":"An alias for `item_ttl`. If both parameters are provided, this value is ignored."},"ItemTtl":{"type":"integer","description":"How long, [in seconds](/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted."},"CollectionTtl":{"type":"integer","description":"How long, [in seconds](/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted."}}},"examples":{"create":{"value":{"lang":"json","value":"{\n  \"Data\": \"{}\",\n  \"Ttl\": 3600\n}","meta":"","code":"{\n  \"Data\": \"{}\",\n  \"Ttl\": 3600\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"Data\"","#7EE787"],[":","#C9D1D9"]," ",["\"{}\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Ttl\"","#7EE787"],[":","#C9D1D9"]," ",["3600","#79C0FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

{" "}

Create a ListItem with the REST API

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function createSyncListItem() {
  const syncListItem = await client.sync.v1
    .services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .syncLists("ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .syncListItems.create({
      data: {
        text: "hello world",
        user: "Charlies Xavier",
      },
    });

  console.log(syncListItem.index);
}

createSyncListItem();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

sync_list_item = (
    client.sync.v1.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .sync_lists("ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .sync_list_items.create(
        data={"text": "hello world", "user": "Charlies Xavier"}
    )
)

print(sync_list_item.index)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Sync.V1.Service.SyncList;
using System.Threading.Tasks;
using System.Collections.Generic;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var syncListItem = await SyncListItemResource.CreateAsync(
            data: new Dictionary<
                string,
                Object>() { { "text", "hello world" }, { "user", "Charlies Xavier" } },
            pathServiceSid: "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            pathListSid: "ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");

        Console.WriteLine(syncListItem.Index);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import java.util.HashMap;
import com.twilio.Twilio;
import com.twilio.rest.sync.v1.service.synclist.SyncListItem;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        SyncListItem syncListItem = SyncListItem
                                        .creator("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
                                            "ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
                                            new HashMap<String, Object>() {
                                                {
                                                    put("text", "hello world");
                                                    put("user", "Charlies Xavier");
                                                }
                                            })
                                        .create();

        System.out.println(syncListItem.getIndex());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	sync "github.com/twilio/twilio-go/rest/sync/v1"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &sync.CreateSyncListItemParams{}
	params.SetData(map[string]interface{}{
		"text": "hello world",
		"user": "Charlies Xavier",
	})

	resp, err := client.SyncV1.CreateSyncListItem("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
		"ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		fmt.Println(resp.Index)
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$sync_list_item = $twilio->sync->v1
    ->services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    ->syncLists("ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    ->syncListItems->create(
        [
            "text" => "hello world",
            "user" => "Charlies Xavier",
        ] // Data
    );

print $sync_list_item->index;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

sync_list_item = @client
                 .sync
                 .v1
                 .services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                 .sync_lists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                 .sync_list_items
                 .create(
                   data: {
                     'text' => 'hello world',
                     'user' => 'Charlies Xavier'
                   }
                 )

puts sync_list_item.index
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:sync:v1:services:lists:items:create \
   --service-sid ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
   --list-sid ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
   --data "{\"text\":\"hello world\",\"user\":\"Charlies Xavier\"}"
```

```bash
DATA_OBJ=$(cat << EOF
{
  "text": "hello world",
  "user": "Charlies Xavier"
}
EOF
)
curl -X POST "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Lists/ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Items" \
--data-urlencode "Data=$DATA_OBJ" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "created_by": "created_by",
  "data": {
    "text": "hello world",
    "user": "Charlies Xavier"
  },
  "date_expires": "2015-07-30T21:00:00Z",
  "date_created": "2015-07-30T20:00:00Z",
  "date_updated": "2015-07-30T20:00:00Z",
  "index": 100,
  "list_sid": "ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "revision": "revision",
  "service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/100"
}
```

```js title="Push JSON into a list using the JavaScript SDK"
syncClient.list("example_list").then(function (list) {
  list
    .push({
      text: "hello world",
      user: "Charles Xavier",
    })
    .then(function (item) {
      console.log("Added: ", item.index);
    })
    .catch(function (err) {
      console.error(err);
    });
});
```

```js title="Subscribe to a ListItem addition with the JavaScript SDK" description="Note: There are two separate events for list item adds and list item updates:"
// !mark(2:4)
syncClient.list("example_list").then(function (list) {
  list.on("itemAdded", function (item) {
    console.log("index", item.index);
    console.log("JSON data", item.value);
  });

  //Note that there are two separate events for list item adds and list item updates:
  list.on("itemUpdated", function (item) {
    console.log("index", item.index);
    console.log("JSON data", item.value);
  });
});
```

## Fetch a ListItem resource

`GET https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{ListSid}/Items/{Index}`

### Path parameters

```json
[{"name":"ServiceSid","in":"path","description":"The SID of the [Sync Service](/docs/sync/api/service) with the Sync List Item resource to fetch.","schema":{"type":"string"},"required":true},{"name":"ListSid","in":"path","description":"The SID of the Sync List with the Sync List Item resource to fetch. Can be the Sync List resource's `sid` or its `unique_name`.","schema":{"type":"string"},"required":true},{"name":"Index","in":"path","description":"The index of the Sync List Item resource to fetch.","schema":{"type":"integer"},"required":true}]
```

{" "}

Fetch a ListItem with the REST API

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function fetchSyncListItem() {
  const syncListItem = await client.sync.v1
    .services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .syncLists("ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .syncListItems(42)
    .fetch();

  console.log(syncListItem.index);
}

fetchSyncListItem();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

sync_list_item = (
    client.sync.v1.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .sync_lists("ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .sync_list_items(42)
    .fetch()
)

print(sync_list_item.index)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Sync.V1.Service.SyncList;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var syncListItem = await SyncListItemResource.FetchAsync(
            pathServiceSid: "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            pathListSid: "ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            pathIndex: 42);

        Console.WriteLine(syncListItem.Index);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.sync.v1.service.synclist.SyncListItem;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        SyncListItem syncListItem =
            SyncListItem.fetcher("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 42)
                .fetch();

        System.out.println(syncListItem.getIndex());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	resp, err := client.SyncV1.FetchSyncListItem("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
		"ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
		42)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		fmt.Println(resp.Index)
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$sync_list_item = $twilio->sync->v1
    ->services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    ->syncLists("ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    ->syncListItems(42)
    ->fetch();

print $sync_list_item->index;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

sync_list_item = @client
                 .sync
                 .v1
                 .services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                 .sync_lists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                 .sync_list_items(42)
                 .fetch

puts sync_list_item.index
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:sync:v1:services:lists:items:fetch \
   --service-sid ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
   --list-sid ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
   --index 42
```

```bash
curl -X GET "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Lists/ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Items/42" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "created_by": "created_by",
  "data": {},
  "date_expires": "2015-07-30T21:00:00Z",
  "date_created": "2015-07-30T20:00:00Z",
  "date_updated": "2015-07-30T20:00:00Z",
  "index": 42,
  "list_sid": "ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "revision": "revision",
  "service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/100"
}
```

```js title="Fetch a ListItem with the JavaScript SDK" description="Fetch only the first item"
syncClient.list("example_list").then(function (list) {
  list.get(0).then(function (item) {
    console.log("show first item", item);
  });
});
```

## Read multiple ListItem resources

`GET https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{ListSid}/Items`

Retrieve all items belonging to a List.

> \[!NOTE]
>
> By default, this will return the first 50 List items. Supply a PageSize argument to fetch up to 100 items at once.
>
> See [paging](/docs/usage/twilios-response#pagination) for more information.

{" "}

### Path parameters

```json
[{"name":"ServiceSid","in":"path","description":"The SID of the [Sync Service](/docs/sync/api/service) with the List Item resources to read.","schema":{"type":"string"},"required":true},{"name":"ListSid","in":"path","description":"The SID of the Sync List with the List Items to read. Can be the Sync List resource's `sid` or its `unique_name`.","schema":{"type":"string"},"required":true}]
```

### Query parameters

```json
[{"name":"Order","in":"query","description":"How to order the List Items returned by their `index` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending.","schema":{"type":"string","enum":["asc","desc"],"refName":"sync_list_item_enum_query_result_order","modelName":"sync_list_item_enum_query_result_order"},"examples":{"readEmpty":{"value":"asc"},"readFull":{"value":"asc"}}},{"name":"From","in":"query","description":"The `index` of the first Sync List Item resource to read. See also `bounds`.","schema":{"type":"string"},"examples":{"readEmpty":{"value":"from"},"readFull":{"value":"from"}}},{"name":"Bounds","in":"query","description":"Whether to include the List Item referenced by the `from` parameter. Can be: `inclusive` to include the List Item referenced by the `from` parameter or `exclusive` to start with the next List Item. The default value is `inclusive`.","schema":{"type":"string","enum":["inclusive","exclusive"],"refName":"sync_list_item_enum_query_from_bound_type","modelName":"sync_list_item_enum_query_from_bound_type"},"examples":{"readEmpty":{"value":"inclusive"},"readFull":{"value":"inclusive"}}},{"name":"PageSize","in":"query","description":"How many resources to return in each list page. The default is 50, and the maximum is 100.","schema":{"type":"integer","format":"int64","minimum":1,"maximum":100}},{"name":"Page","in":"query","description":"The page index. This value is simply for client state.","schema":{"type":"integer","minimum":0}},{"name":"PageToken","in":"query","description":"The page token. This is provided by the API.","schema":{"type":"string"}}]
```

{" "}

Get ListItems using the REST API

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function listSyncListItem() {
  const syncListItems = await client.sync.v1
    .services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .syncLists("ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .syncListItems.list({ limit: 20 });

  syncListItems.forEach((s) => console.log(s.index));
}

listSyncListItem();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

sync_list_items = (
    client.sync.v1.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .sync_lists("ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .sync_list_items.list(limit=20)
)

for record in sync_list_items:
    print(record.index)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Sync.V1.Service.SyncList;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var syncListItems = await SyncListItemResource.ReadAsync(
            pathServiceSid: "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            pathListSid: "ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            limit: 20);

        foreach (var record in syncListItems) {
            Console.WriteLine(record.Index);
        }
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.sync.v1.service.synclist.SyncListItem;
import com.twilio.base.ResourceSet;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        ResourceSet<SyncListItem> syncListItems =
            SyncListItem.reader("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
                .limit(20)
                .read();

        for (SyncListItem record : syncListItems) {
            System.out.println(record.getIndex());
        }
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	sync "github.com/twilio/twilio-go/rest/sync/v1"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &sync.ListSyncListItemParams{}
	params.SetLimit(20)

	resp, err := client.SyncV1.ListSyncListItem("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
		"ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		for record := range resp {
			fmt.Println(resp[record].Index)
		}
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$syncListItems = $twilio->sync->v1
    ->services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    ->syncLists("ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    ->syncListItems->read([], 20);

foreach ($syncListItems as $record) {
    print $record->index;
}
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

sync_list_items = @client
                  .sync
                  .v1
                  .services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                  .sync_lists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                  .sync_list_items
                  .list(limit: 20)

sync_list_items.each do |record|
   puts record.index
end
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:sync:v1:services:lists:items:list \
   --service-sid ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
   --list-sid ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
```

```bash
curl -X GET "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Lists/ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Items?PageSize=20" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "items": [],
  "meta": {
    "first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0",
    "key": "items",
    "next_page_url": null,
    "page": 0,
    "page_size": 50,
    "previous_page_url": null,
    "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0"
  }
}
```

```js title="Get ListItems using the JavaScript SDK" description="Display the first item only"
syncClient.list("example_list").then(function (list) {
  list.getItems().then(function (page) {
    console.log("show first item", page.items[0]);
  });
});
```

## Update a ListItem resource

`POST https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{ListSid}/Items/{Index}`

### Headers

```json
[{"name":"If-Match","in":"header","description":"If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match).","schema":{"type":"string"}}]
```

### Path parameters

```json
[{"name":"ServiceSid","in":"path","description":"The SID of the [Sync Service](/docs/sync/api/service) with the Sync List Item resource to update.","schema":{"type":"string"},"required":true},{"name":"ListSid","in":"path","description":"The SID of the Sync List with the Sync List Item resource to update. Can be the Sync List resource's `sid` or its `unique_name`.","schema":{"type":"string"},"required":true},{"name":"Index","in":"path","description":"The index of the Sync List Item resource to update.","schema":{"type":"integer"},"required":true}]
```

### Request body parameters

```json
{"schema":{"type":"object","title":"UpdateSyncListItemRequest","properties":{"Data":{"description":"A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length.","x-twilio":{"pii":{"handling":"sensitive","deleteSla":7}}},"Ttl":{"type":"integer","description":"An alias for `item_ttl`. If both parameters are provided, this value is ignored."},"ItemTtl":{"type":"integer","description":"How long, [in seconds](/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted."},"CollectionTtl":{"type":"integer","description":"How long, [in seconds](/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. This parameter can only be used when the List Item's `data` or `ttl` is updated in the same request."}}},"examples":{"update":{"value":{"lang":"json","value":"{\n  \"Data\": \"{}\",\n  \"Ttl\": 3600\n}","meta":"","code":"{\n  \"Data\": \"{}\",\n  \"Ttl\": 3600\n}","tokens":[["{","#C9D1D9"],"\n  ",["\"Data\"","#7EE787"],[":","#C9D1D9"]," ",["\"{}\"","#A5D6FF"],[",","#C9D1D9"],"\n  ",["\"Ttl\"","#7EE787"],[":","#C9D1D9"]," ",["3600","#79C0FF"],"\n",["}","#C9D1D9"]],"annotations":[],"themeName":"github-dark","style":{"color":"#c9d1d9","background":"#0d1117"}}}},"encodingType":"application/x-www-form-urlencoded","conditionalParameterMap":{}}
```

{" "}

Update a ListItem with the REST API

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function updateSyncListItem() {
  const syncListItem = await client.sync.v1
    .services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .syncLists("ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .syncListItems(42)
    .update({
      data: {
        user: "Wolverine",
      },
    });

  console.log(syncListItem.index);
}

updateSyncListItem();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

sync_list_item = (
    client.sync.v1.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .sync_lists("ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .sync_list_items(42)
    .update(data={"user": "Wolverine"})
)

print(sync_list_item.index)
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Sync.V1.Service.SyncList;
using System.Threading.Tasks;
using System.Collections.Generic;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var syncListItem = await SyncListItemResource.UpdateAsync(
            data: new Dictionary<string, Object>() { { "user", "Wolverine" } },
            pathServiceSid: "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            pathListSid: "ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            pathIndex: 42);

        Console.WriteLine(syncListItem.Index);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import java.util.HashMap;
import com.twilio.Twilio;
import com.twilio.rest.sync.v1.service.synclist.SyncListItem;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        SyncListItem syncListItem =
            SyncListItem.updater("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 42)
                .setData(new HashMap<String, Object>() {
                    {
                        put("user", "Wolverine");
                    }
                })
                .update();

        System.out.println(syncListItem.getIndex());
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	sync "github.com/twilio/twilio-go/rest/sync/v1"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &sync.UpdateSyncListItemParams{}
	params.SetData(map[string]interface{}{
		"user": "Wolverine",
	})

	resp, err := client.SyncV1.UpdateSyncListItem("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
		"ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
		42,
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	} else {
		fmt.Println(resp.Index)
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$sync_list_item = $twilio->sync->v1
    ->services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    ->syncLists("ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    ->syncListItems(42)
    ->update([
        "data" => [
            "user" => "Wolverine",
        ],
    ]);

print $sync_list_item->index;
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

sync_list_item = @client
                 .sync
                 .v1
                 .services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                 .sync_lists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
                 .sync_list_items(42)
                 .update(
                   data: {
                     'user' => 'Wolverine'
                   }
                 )

puts sync_list_item.index
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:sync:v1:services:lists:items:update \
   --service-sid ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
   --list-sid ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
   --index 42 \
   --data "{\"user\":\"Wolverine\"}"
```

```bash
DATA_OBJ=$(cat << EOF
{
  "user": "Wolverine"
}
EOF
)
curl -X POST "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Lists/ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Items/42" \
--data-urlencode "Data=$DATA_OBJ" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```json
{
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "created_by": "created_by",
  "data": {
    "user": "Wolverine"
  },
  "date_expires": "2015-07-30T21:00:00Z",
  "date_created": "2015-07-30T20:00:00Z",
  "date_updated": "2015-07-30T20:00:00Z",
  "index": 42,
  "list_sid": "ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "revision": "revision",
  "service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/100"
}
```

```js title="Change data in a single ListItem with the JavaScript SDK" description="Use the set method to change the data in a ListItem"
syncClient.list("example_list").then(function (list) {
  var newValue = {
    text: "hello world",
    user: "Wolverine",
  };
  list.set(0, newValue).then(function (item) {
    console.log("updated first item", item);
  });
});
```

**Note**: Using `set` will overwrite any existing data in a list item.

```js title="Update data in a ListItem with the JavaScript SDK" description="Use the update method to change data in a ListItem."
syncClient.list("example-list").then(function (list) {
  list.update(0, { user: "Magneto" });
});
```

```js title="Mutate data in a ListItem using the JavaScript SDK" description="Use mutate for more fine-grained control"
syncClient.list("example-list").then(function (list) {
  list.mutate(0, function (remoteData) {
    remoteData.user = "Cyclops";
    return remoteData;
  });
});
```

The `mutate` function helps your JavaScript code respond to concurrent updates with versioned control. See the corresponding [JavaScript SDK](/docs/sync/javascript/changelog) documentation for details.

```js title="Subscribe to a ListItem update with the JavaScript SDK" description="Note: There are two separate events for list item adds and list item updates:"
// !mark(8:11)
syncClient.list("example_list").then(function (list) {
  list.on("itemAdded", function (item) {
    console.log("index", item.index);
    console.log("JSON data", item.value);
  });

  //Note that there are two separate events for list item adds and list item updates:
  list.on("itemUpdated", function (item) {
    console.log("index", item.index);
    console.log("JSON data", item.value);
  });
});
```

## Delete a ListItem resource

`DELETE https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{ListSid}/Items/{Index}`

### Headers

```json
[{"name":"If-Match","in":"header","description":"If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match).","schema":{"type":"string"}}]
```

### Path parameters

```json
[{"name":"ServiceSid","in":"path","description":"The SID of the [Sync Service](/docs/sync/api/service) with the Sync List Item resource to delete.","schema":{"type":"string"},"required":true},{"name":"ListSid","in":"path","description":"The SID of the Sync List with the Sync List Item resource to delete. Can be the Sync List resource's `sid` or its `unique_name`.","schema":{"type":"string"},"required":true},{"name":"Index","in":"path","description":"The index of the Sync List Item resource to delete.","schema":{"type":"integer"},"required":true}]
```

{" "}

Delete a ListItem with the REST API

```js
// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function deleteSyncListItem() {
  await client.sync.v1
    .services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .syncLists("ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    .syncListItems(42)
    .remove();
}

deleteSyncListItem();
```

```python
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

client.sync.v1.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").sync_lists(
    "ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
).sync_list_items(42).delete()
```

```csharp
// Install the C# / .NET helper library from twilio.com/docs/csharp/install

using System;
using Twilio;
using Twilio.Rest.Sync.V1.Service.SyncList;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        await SyncListItemResource.DeleteAsync(
            pathServiceSid: "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            pathListSid: "ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
            pathIndex: 42);
    }
}
```

```java
// Install the Java helper library from twilio.com/docs/java/install

import com.twilio.Twilio;
import com.twilio.rest.sync.v1.service.synclist.SyncListItem;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        SyncListItem.deleter("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 42).delete();
    }
}
```

```go
// Download the helper library from https://www.twilio.com/docs/go/install
package main

import (
	"fmt"
	"github.com/twilio/twilio-go"
	sync "github.com/twilio/twilio-go/rest/sync/v1"
	"os"
)

func main() {
	// Find your Account SID and Auth Token at twilio.com/console
	// and set the environment variables. See http://twil.io/secure
	// Make sure TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN exists in your environment
	client := twilio.NewRestClient()

	params := &sync.DeleteSyncListItemParams{}

	err := client.SyncV1.DeleteSyncListItem("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
		"ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
		42,
		params)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	}
}
```

```php
<?php

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once "/path/to/vendor/autoload.php";

use Twilio\Rest\Client;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$twilio->sync->v1
    ->services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    ->syncLists("ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
    ->syncListItems(42)
    ->delete();
```

```ruby
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

@client
  .sync
  .v1
  .services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
  .sync_lists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
  .sync_list_items(42)
  .delete
```

```bash
# Install the twilio-cli from https://twil.io/cli

twilio api:sync:v1:services:lists:items:remove \
   --service-sid ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
   --list-sid ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
   --index 42
```

```bash
curl -X DELETE "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Lists/ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Items/42" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
```

```js title="Delete a ListItem with the JavaScript SDK" description="Deletes the 0-index item in a Sync List"
syncClient.list("example_list").then(function (list) {
  list.remove(0).then(function () {
    console.log("deleted first item");
  });
});
```
