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

Document Permission Resource


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

We recommend following the standard URI specification and avoid the following reserved characters ! * ' ( ) ; : @ & = + $ , / ? % # [ ] for values such as identity and friendly name.


Document Permission properties

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

The SID of the Account that created the Document 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

document_sidSID<ET>

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

Pattern: ^ET[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 Document.


writeboolean

Whether the identity can update the Sync Document.


manageboolean

Whether the identity can delete the Sync Document.


urlstring<uri>

The absolute URL of the Sync Document Permission resource.


Fetch a Document Permission resource

fetch-a-document-permission-resource page anchor
GET https://sync.twilio.com/v1/Services/{ServiceSid}/Documents/{DocumentSid}/Permissions/{Identity}

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
ServiceSidstringrequired

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


DocumentSidstringrequired

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


Identitystringrequired

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

Fetch a Document Permission resource

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

_12
// Download the helper library from https://www.twilio.com/docs/node/install
_12
// Find your Account SID and Auth Token at twilio.com/console
_12
// and set the environment variables. See http://twil.io/secure
_12
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12
const authToken = process.env.TWILIO_AUTH_TOKEN;
_12
const client = require('twilio')(accountSid, authToken);
_12
_12
client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.documentPermissions('identity')
_12
.fetch()
_12
.then(document_permission => console.log(document_permission.serviceSid));

Output

_10
{
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"document_sid": "ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"identity": "identity",
_10
"read": true,
_10
"write": true,
_10
"manage": true,
_10
"url": "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Documents/ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Permissions/identity"
_10
}


Read multiple Document Permission resources

read-multiple-document-permission-resources page anchor
GET https://sync.twilio.com/v1/Services/{ServiceSid}/Documents/{DocumentSid}/Permissions

Property nameTypeRequiredPIIDescription
ServiceSidstringrequired

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


DocumentSidstringrequired

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

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

_12
// Download the helper library from https://www.twilio.com/docs/node/install
_12
// Find your Account SID and Auth Token at twilio.com/console
_12
// and set the environment variables. See http://twil.io/secure
_12
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12
const authToken = process.env.TWILIO_AUTH_TOKEN;
_12
const client = require('twilio')(accountSid, authToken);
_12
_12
client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.documentPermissions
_12
.list({limit: 20})
_12
.then(documentPermissions => documentPermissions.forEach(d => console.log(d.serviceSid)));

Output

_23
{
_23
"permissions": [
_23
{
_23
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_23
"service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_23
"document_sid": "ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_23
"identity": "identity",
_23
"read": true,
_23
"write": true,
_23
"manage": true,
_23
"url": "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Documents/ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Permissions/identity"
_23
}
_23
],
_23
"meta": {
_23
"first_page_url": "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0",
_23
"key": "permissions",
_23
"next_page_url": "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=1",
_23
"page": 0,
_23
"page_size": 50,
_23
"previous_page_url": "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0",
_23
"url": "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0"
_23
}
_23
}


Update a Document Permission resource

update-a-document-permission-resource page anchor
POST https://sync.twilio.com/v1/Services/{ServiceSid}/Documents/{DocumentSid}/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 Document Permission resource to update.


DocumentSidstringrequired

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


Identitystringrequired

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

Property nameTypeRequiredPIIDescription
Readbooleanrequired

Whether the identity can read the Sync Document. Default value is false.


Writebooleanrequired

Whether the identity can update the Sync Document. Default value is false.


Managebooleanrequired

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

Update a Document Permission resource

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

_12
// Download the helper library from https://www.twilio.com/docs/node/install
_12
// Find your Account SID and Auth Token at twilio.com/console
_12
// and set the environment variables. See http://twil.io/secure
_12
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12
const authToken = process.env.TWILIO_AUTH_TOKEN;
_12
const client = require('twilio')(accountSid, authToken);
_12
_12
client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12
.documentPermissions('identity')
_12
.update({read: true, write: true, manage: true})
_12
.then(document_permission => console.log(document_permission.serviceSid));

Output

_10
{
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"service_sid": "ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"document_sid": "ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"identity": "identity",
_10
"read": true,
_10
"write": true,
_10
"manage": true,
_10
"url": "https://sync.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Documents/ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Permissions/identity"
_10
}


Delete a Document Permission resource

delete-a-document-permission-resource page anchor
DELETE https://sync.twilio.com/v1/Services/{ServiceSid}/Documents/{DocumentSid}/Permissions/{Identity}

Property nameTypeRequiredPIIDescription
ServiceSidstringrequired

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


DocumentSidstringrequired

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


Identitystringrequired

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

Delete a Document Permission resource

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

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.documentPermissions('identity')
_11
.remove();


Rate this page: