Note that the {databaseaccount} is the name of the Azure Cosmos DB account created under your subscription. The {db-id} value is the user generated name/ID of the database, not the system generated ID (rid). The {user-name} value is the name of the user that owns the permission.
The validity period of the resource token returned by the operation. By default, a resource token is valid for one hour. To override the default, set this header with the desired validity period in seconds. The max override value is 18000, which is five hours.
Body
Property
Required
Type
Description
id
Required
String
It is a user settable property. It is a unique name to identify the permission, that is, no two permissions owned by a user can share the same id. The id must not exceed 255 characters.
permissionMode
Required
String
The access mode for the resource: All or Read. All provides read, write, and delete access to a resource. Read restricts the user to read access on the resource.
resource
Required
String
The full addressable path of the resource associated with the permission. For example, dbs/volcanodb/colls/volcano1.
The following table lists common status codes returned by this operation. For a full list of status codes, see HTTP Status Codes.
HTTP status code
Description
201 Created
The operation was successful.
400 Bad Request
The JSON body is invalid. Check for missing curly brackets or quotes. In addition, 400 is returned when at least one of the settable properties is not in the request body. Check to ensure all three settable properties are included.
409 Conflict
The ID provided for the new permission has been taken by an existing permission. 409 is also returned when the new permission is assigned to a resource already associated with another permission for the user.
Body
Property
Description
_rid
It is a system generated property. The resource id (_rid) is a unique identifier that is also hierarchical per the resource stack on the resource model. It is used internally for placement and navigation of the permission resource.
_ts
It is a system generated property. It specifies the last updated timestamp of the resource. The value is a timestamp.
_self
It is a system generated property. It is the unique addressable URI for the resource.
_etag
It is a system generated property that represents the resource etag required for optimistic concurrency control.
_token
It is a system generated resource token for the particular resource and user.