Amazon WorkDocs
API Reference (API Version 2016-05-01)

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.


Creates a set of permissions for the specified folder or document. The resource permissions are overwritten if the principals already have different permissions.

Request Syntax

POST /api/v1/resources/ResourceId/permissions HTTP/1.1 Authentication: AuthenticationToken Content-type: application/json { "NotificationOptions": { "EmailMessage": "string", "SendEmail": boolean }, "Principals": [ { "Id": "string", "Role": "string", "Type": "string" } ] }

URI Request Parameters

The request requires the following URI parameters.


Amazon WorkDocs authentication token. Do not set this field when using administrative API actions, as in accessing the API using AWS credentials.

Length Constraints: Minimum length of 1. Maximum length of 8199.


The ID of the resource.

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: [\w+-.@]+

Request Body

The request accepts the following data in JSON format.


The notification options.

Type: NotificationOptions object

Required: No


The users, groups, or organization being granted permission.

Type: Array of SharePrincipal objects

Required: Yes

Response Syntax

HTTP/1.1 201 Content-type: application/json { "ShareResults": [ { "InviteePrincipalId": "string", "PrincipalId": "string", "Role": "string", "ShareId": "string", "Status": "string", "StatusMessage": "string" } ] }

Response Elements

If the action is successful, the service sends back an HTTP 201 response.

The following data is returned in JSON format by the service.


The share results.

Type: Array of ShareResult objects


For information about the errors that are common to all actions, see Common Errors.


The AWS Directory Service cannot reach an on-premises instance. Or a dependency under the control of the organization is failing, such as a connected Active Directory.

HTTP Status Code: 424


One or more of the dependencies is unavailable.

HTTP Status Code: 503


The operation is not permitted.

HTTP Status Code: 403


The caller does not have access to perform the action on the resource.

HTTP Status Code: 404

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: