Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Sync Map Permission Resource


The Sync Map 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 Map Permission resource is the same as setting all permissions to false.


Sync Map Permission properties

sync-map-permission-properties page anchor
Property nameTypePIIDescription
account_sidSID<AC>
Not PII

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

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

service_sidSID<IS>

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

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

map_sidSID<MP>

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

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

identitystring
PII MTL: 30 days

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


readboolean

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


writeboolean

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


manageboolean

Whether the identity can delete the Sync Map.


urlstring<uri>

The absolute URL of the Sync Map Permission resource.


Fetch a Sync Map Permission resource

fetch-a-sync-map-permission-resource page anchor
GET https://sync.twilio.com/v1/Services/{ServiceSid}/Maps/{MapSid}/Permissions/{Identity}

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
ServiceSidstringrequired

The SID of the Sync Service with the Sync Map Permission resource to fetch. Can be the Service's sid value or default.


MapSidstringrequired

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


Identitystringrequired

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

Fetch a Sync Map Permission resource

fetch-a-sync-map-permission-resource-1 page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_16
// Download the helper library from https://www.twilio.com/docs/node/install
_16
import twilio from "twilio";
_16
_16
// Find your Account SID and Auth Token at twilio.com/console
_16
// and set the environment variables. See http://twil.io/secure
_16
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16
const authToken = process.env.TWILIO_AUTH_TOKEN;
_16
const client = twilio(accountSid, authToken);
_16
_16
const syncMapPermission = await client.sync.v1
_16
.services("ServiceSid")
_16
.syncMaps("MapSid")
_16
.syncMapPermissions("Identity")
_16
.fetch();
_16
_16
console.log(syncMapPermission.accountSid);

Output

_10
{
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"service_sid": "ServiceSid",
_10
"map_sid": "MapSid",
_10
"identity": "Identity",
_10
"read": true,
_10
"write": true,
_10
"manage": true,
_10
"url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity"
_10
}


Read multiple Sync Map Permission resources

read-multiple-sync-map-permission-resources page anchor
GET https://sync.twilio.com/v1/Services/{ServiceSid}/Maps/{MapSid}/Permissions

Property nameTypeRequiredPIIDescription
ServiceSidstringrequired

The SID of the Sync Service with the Sync Map Permission resources to read. Can be the Service's sid value or default.


MapSidstringrequired

The SID of the Sync Map with the Permission resources to read. Can be the Sync Map 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 Map Permission resources

read-multiple-sync-map-permission-resources-1 page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_15
// Download the helper library from https://www.twilio.com/docs/node/install
_15
import twilio from "twilio";
_15
_15
// Find your Account SID and Auth Token at twilio.com/console
_15
// and set the environment variables. See http://twil.io/secure
_15
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_15
const authToken = process.env.TWILIO_AUTH_TOKEN;
_15
const client = twilio(accountSid, authToken);
_15
_15
const syncMapPermissions = await client.sync.v1
_15
.services("ServiceSid")
_15
.syncMaps("MapSid")
_15
.syncMapPermissions.list({ limit: 20 });
_15
_15
syncMapPermissions.forEach((s) => console.log(s.accountSid));

Output

_12
{
_12
"permissions": [],
_12
"meta": {
_12
"first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0",
_12
"key": "permissions",
_12
"next_page_url": null,
_12
"page": 0,
_12
"page_size": 50,
_12
"previous_page_url": null,
_12
"url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0"
_12
}
_12
}


Update a Sync Map Permission resource

update-a-sync-map-permission-resource page anchor
POST https://sync.twilio.com/v1/Services/{ServiceSid}/Maps/{MapSid}/Permissions/{Identity}

Updates the permissions of the sync map 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 Map Permission resource to update. Can be the Service's sid value or default.


MapSidstringrequired

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


Identitystringrequired

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

Property nameTypeRequiredPIIDescription
Readbooleanrequired

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


Writebooleanrequired

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


Managebooleanrequired

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

Update a Sync Map Permission resource

update-a-sync-map-permission-resource-1 page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_20
// Download the helper library from https://www.twilio.com/docs/node/install
_20
import twilio from "twilio";
_20
_20
// Find your Account SID and Auth Token at twilio.com/console
_20
// and set the environment variables. See http://twil.io/secure
_20
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_20
const authToken = process.env.TWILIO_AUTH_TOKEN;
_20
const client = twilio(accountSid, authToken);
_20
_20
const syncMapPermission = await client.sync.v1
_20
.services("ServiceSid")
_20
.syncMaps("MapSid")
_20
.syncMapPermissions("Identity")
_20
.update({
_20
manage: false,
_20
read: true,
_20
write: false,
_20
});
_20
_20
console.log(syncMapPermission.accountSid);

Output

_10
{
_10
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_10
"service_sid": "ServiceSid",
_10
"map_sid": "MapSid",
_10
"identity": "Identity",
_10
"read": true,
_10
"write": false,
_10
"manage": false,
_10
"url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity"
_10
}


Delete a Sync Map Permission resource

delete-a-sync-map-permission-resource page anchor
DELETE https://sync.twilio.com/v1/Services/{ServiceSid}/Maps/{MapSid}/Permissions/{Identity}

Property nameTypeRequiredPIIDescription
ServiceSidstringrequired

The SID of the Sync Service with the Sync Map Permission resource to delete. Can be the Service's sid value or default.


MapSidstringrequired

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


Identitystringrequired

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

Delete a Sync Map Permission resource

delete-a-sync-map-permission-resource-1 page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
import twilio from "twilio";
_14
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = twilio(accountSid, authToken);
_14
_14
await client.sync.v1
_14
.services("ServiceSid")
_14
.syncMaps("MapSid")
_14
.syncMapPermissions("Identity")
_14
.remove();


Rate this page: