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.

updateProfile #

Updates a security profile definition.


Query Syntax #

HTTP #

Copied to clipboard!
URL: http://kuzzle:7512/profiles/<_id>/_update[?refresh=wait_for]
Method: PUT
Body:
Copied to clipboard!
{
    "policies": [
      {
        "roleId": "<roleId>"
      },
      {
        "roleId": "<roleId>",
        "restrictedTo": [
          {
            "index": "<index>"
          },
          {
            "index": "<index>",
            "collections": [
              "<coll1>",
              "<coll2>"
            ]
          }
        ]
      }
    ]
}

Other protocols #

Copied to clipboard!
{
  "controller": "security",
  "action": "updateProfile",
  "_id": "<profileId>",
  "body": {
    "policies": [
      {
        "roleId": "<roleId>"
      },
      {
        "roleId": "<roleId>",
        "restrictedTo": [
          {
            "index": "<index>"
          },
          {
            "index": "<index>",
            "collections": [
              "<coll1>",
              "<coll2>"
            ]
          }
        ]
      }
    ]
  }
}

Arguments #

  • _id: profile identifier

Optional: #

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

Body properties #


Response #

Returns the updated profile identifier and version number.

Copied to clipboard!
{
  "status": 200,
  "error": null,
  "action": "updateProfile",
  "controller": "security",
  "requestId": "<unique request identifier>",
  "result": {
    "_id": "<profileId>",
    "_version": 2
  }
}