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 #

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

Other protocols #

{
  "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.

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