Core 2.x

updateProfile

Updates a security profile definition.


Query Syntax

HTTP

Copied to clipboard!
URL: http://kuzzle:7512/profiles/<_id>/_update[?refresh=wait_for][&retryOnConflict=10]
Method: PUT
Body:
Copied to clipboard!
{
  "rateLimit": 50,
  "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": {
    "rateLimit": 50,
    "policies": [
      {
        "roleId": "<roleId>"
      },
      {
        "roleId": "<roleId>",
        "restrictedTo": [
          {
            "index": "<index>"
          },
          {
            "index": "<index>",
            "collections": [
              "<coll1>",
              "<coll2>"
            ]
          }
        ]
      }
    ]
  },
  // Optional
  "refresh": "wait_for",
  "retryOnConflict": 10
}

Arguments

  • _id: profile identifier

Optional arguments

  • refresh: if set to wait_for, Kuzzle will not respond until the user changes are indexed (default: "wait_for")
  • retryOnConflict: in case of an update conflict in Elasticsearch, the number of retries before aborting the operation (default: 10)

Body properties

See the profile definition guide.


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
  }
}