API Keys

Set the collection access level

Sets the collection access level for the collection in the database dbname for API key with keyid.

Requires a JSON object with these properties:

  • grant: Use "rw" to set the collection level access to Read/Write. Use "ro" to set the collection level access to Read Only. Use "none" to set the collection level access to No access.

  • collection: Use "*" to set default access level for all collections.

If access level for collection is not set default("*") access level is used. If default("*") access level is also not set database access level is used.

Note: Requires administrator permissions.

put/_api/key/{keyid}/database/{dbname}/collection/{collection}

Request

Path parameters

keyidstring string required

The id of the API key.

dbnamestring string required

The name of the database.

collectionstring string required

The name of the collection.

Request body

grantstring required
  • Use "rw" to set the collection level access to Read/Write.
  • Use "ro" to set the collection level access to Read Only.
  • Use "none" to set the collection level access to No access.

Example request

{
  "grant": "rw"
}

Response

Successfully changed access level.

codeinteger

HTTP response code.

errorboolean

Flag if there is an error in response. False for this response.

_system/test1string

Example response

{
  "code": 200,
  "_system/test1": "rw"
}

Changes

No recorded changes to this operation across all 1 revision of this API.