Skip to contentSkip to navigationSkip to topbar
On this page

Sync List Permission Resource


The Sync List Permission resource represents the permissions that apply to any SDKs authenticated with a matching Identity specified in the Auth Token.

Permissions bind an identity to an object with flags that specify the permission to read, write, and manage the object. Permissions do not have a SID or a unique path; instead, they are identified by the Service, Object, and Token Identity specified in the URL.

Permissions can be updated, fetched, and read. Deleting a Sync List Permission resource is the same as setting all permissions to false.


Sync List Permission properties

sync-list-permission-properties page anchor
Property nameTypeRequiredDescriptionChild properties
account_sidSID<AC>Optional
Not PII

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

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

service_sidSID<IS>Optional

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

Pattern: ^IS[0-9a-fA-F]{32}$Min length: 34Max length: 34

list_sidSID<ES>Optional

The SID of the Sync List to which the Permission applies.

Pattern: ^ES[0-9a-fA-F]{32}$Min length: 34Max length: 34

identitystringOptional
PII MTL: 30 days

The application-defined string that uniquely identifies the resource's User within the Service to an FPA token.


readbooleanOptional

Whether the identity can read the Sync List and its Items.


writebooleanOptional

Whether the identity can create, update, and delete Items in the Sync List.


managebooleanOptional

Whether the identity can delete the Sync List.


urlstring<uri>Optional

The absolute URL of the Sync List Permission resource.


Fetch a Sync List Permission resource

fetch-a-sync-list-permission-resource page anchor
GET https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{ListSid}/Permissions/{Identity}

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
ServiceSidstringrequired

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


ListSidstringrequired

The SID of the Sync List with the Sync List Permission resource to fetch. Can be the Sync List resource's sid or its unique_name.


Identitystringrequired

The application-defined string that uniquely identifies the User's Sync List Permission resource to fetch.

Fetch a Sync List Permission resourceLink to code sample: Fetch a Sync List Permission resource
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchSyncListPermission() {
11
const syncListPermission = await client.sync.v1
12
.services("ServiceSid")
13
.syncLists("ListSid")
14
.syncListPermissions("Identity")
15
.fetch();
16
17
console.log(syncListPermission.accountSid);
18
}
19
20
fetchSyncListPermission();

Output

1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"service_sid": "ServiceSid",
4
"list_sid": "ListSid",
5
"identity": "Identity",
6
"read": true,
7
"write": true,
8
"manage": true,
9
"url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity"
10
}

Read multiple Sync List Permission resources

read-multiple-sync-list-permission-resources page anchor
GET https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{ListSid}/Permissions

Property nameTypeRequiredPIIDescription
ServiceSidstringrequired

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


ListSidstringrequired

The SID of the Sync List with the Sync List Permission resources to read. Can be the Sync List resource's sid or its unique_name.

Property nameTypeRequiredPIIDescription
PageSizeintegerOptional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

PageintegerOptional

The page index. This value is simply for client state.

Minimum: 0

PageTokenstringOptional

The page token. This is provided by the API.

Read multiple Sync List Permission resourcesLink to code sample: Read multiple Sync List Permission resources
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listSyncListPermission() {
11
const syncListPermissions = await client.sync.v1
12
.services("ServiceSid")
13
.syncLists("ListSid")
14
.syncListPermissions.list({ limit: 20 });
15
16
syncListPermissions.forEach((s) => console.log(s.accountSid));
17
}
18
19
listSyncListPermission();

Output

1
{
2
"permissions": [],
3
"meta": {
4
"first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0",
5
"key": "permissions",
6
"next_page_url": null,
7
"page": 0,
8
"page_size": 50,
9
"previous_page_url": null,
10
"url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0"
11
}
12
}

Update a Sync List Permission resource

update-a-sync-list-permission-resource page anchor
POST https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{ListSid}/Permissions/{Identity}

Updates the permissions of the document for the Identity specified in the URL.

(warning)

Warning

Permissions only take effect if the ACLEnabled flag is set on your Service instance.

Your servers are always in "God Mode", meaning they have full access to all your account's Sync resources regardless of the value of the Service's ACLEnabled flag or how the Permissions are configured.

Property nameTypeRequiredPIIDescription
ServiceSidstringrequired

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


ListSidstringrequired

The SID of the Sync List with the Sync List Permission resource to update. Can be the Sync List resource's sid or its unique_name.


Identitystringrequired

The application-defined string that uniquely identifies the User's Sync List Permission resource to update.

Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
Readbooleanrequired

Whether the identity can read the Sync List and its Items. Default value is false.


Writebooleanrequired

Whether the identity can create, update, and delete Items in the Sync List. Default value is false.


Managebooleanrequired

Whether the identity can delete the Sync List. Default value is false.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function updateSyncListPermission() {
11
const syncListPermission = await client.sync.v1
12
.services("ServiceSid")
13
.syncLists("ListSid")
14
.syncListPermissions("Identity")
15
.update({
16
manage: false,
17
read: false,
18
write: false,
19
});
20
21
console.log(syncListPermission.accountSid);
22
}
23
24
updateSyncListPermission();

Output

1
{
2
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"service_sid": "ServiceSid",
4
"list_sid": "ListSid",
5
"identity": "Identity",
6
"read": false,
7
"write": false,
8
"manage": false,
9
"url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity"
10
}

Delete a Sync List Permission resource

delete-a-sync-list-permission-resource page anchor
DELETE https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{ListSid}/Permissions/{Identity}

Property nameTypeRequiredPIIDescription
ServiceSidstringrequired

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


ListSidstringrequired

The SID of the Sync List with the Sync List Permission resource to delete. Can be the Sync List resource's sid or its unique_name.


Identitystringrequired

The application-defined string that uniquely identifies the User's Sync List Permission resource to delete.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function deleteSyncListPermission() {
11
await client.sync.v1
12
.services("ServiceSid")
13
.syncLists("ListSid")
14
.syncListPermissions("Identity")
15
.remove();
16
}
17
18
deleteSyncListPermission();

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.