AddResourcePermissions - Amazon WorkDocs


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 uses the following URI parameters.


Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

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+-.@]+

Required: Yes

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


The specified document version is not in the INITIALIZED state.

HTTP Status Code: 409


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: