Core
API v1.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

updateRole #

Updates a security role definition.

Note: partial updates are not supported for roles, this API route will replace the entire role content with the provided one.


Query Syntax #

HTTP #

URL: http://kuzzle:7512/roles/<_id>/_update[?refresh=wait_for]
Method: PUT
Body:
{
  "controllers": {
    "*": {
      "actions": {
        "*": true
      }
    }
  }
}

Other protocols #

{
  "controller": "security",
  "action": "updateRole",
  "_id": "<roleId>",
  "body": {
    "controllers": {
      "*": {
        "actions": {
          "*": true
        }
      }
    }
  }
}

Arguments #

  • _id: role identifier

Optional: #

  • refresh: if set to wait_for, Kuzzle will not respond until the role changes are indexed

Body properties #


Response #

Returns the updated role identifier and version number.

{
  "status": 200,
  "error": null,
  "action": "updateRole",
  "controller": "security",
  "requestId": "<unique request identifier>",
  "result": {
    "_id": "<roleId>",
    "_version": 2
  }
}