Create or update application privileges Added in 6.4.0

PUT /_security/privilege

To use this API, you must have one of the following privileges:

  • The manage_security cluster privilege (or a greater privilege such as all).
  • The "Manage Application Privileges" global privilege for the application being referenced in the request.

Application names are formed from a prefix, with an optional suffix that conform to the following rules:

  • The prefix must begin with a lowercase ASCII letter.
  • The prefix must contain only ASCII letters or digits.
  • The prefix must be at least 3 characters long.
  • If the suffix exists, it must begin with either a dash - or _.
  • The suffix cannot contain any of the following characters: \, /, *, ?, ", <, >, |, ,, *.
  • No part of the name can contain whitespace.

Privilege names must begin with a lowercase ASCII letter and must contain only ASCII letters and digits along with the characters _, -, and ..

Action names can contain any number of printable ASCII characters and must contain at least one of the following characters: /, *, :.

Query parameters

  • refresh string

    If true (the default) then refresh the affected shards to make this operation visible to search, if wait_for then wait for a refresh to make this operation visible to search, if false then do nothing with refreshes.

    Values are true, false, or wait_for.

application/json

Body Required

  • * object Additional properties
    Hide * attribute Show * attribute object
    • * object Additional properties

      Additional properties are allowed.

      Hide * attributes Show * attributes object

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • * object Additional properties
      Hide * attribute Show * attribute object
      • * object

        Additional properties are allowed.

        Hide * attribute Show * attribute object
PUT /_security/privilege
curl \
 -X PUT http://api.example.com/_security/privilege \
 -H "Content-Type: application/json" \
 -d '{"additionalProperty1":{"additionalProperty1":{"actions":["string"],"application":"string","name":"string","metadata":{"additionalProperty1":{},"additionalProperty2":{}}},"additionalProperty2":{"actions":["string"],"application":"string","name":"string","metadata":{"additionalProperty1":{},"additionalProperty2":{}}}},"additionalProperty2":{"additionalProperty1":{"actions":["string"],"application":"string","name":"string","metadata":{"additionalProperty1":{},"additionalProperty2":{}}},"additionalProperty2":{"actions":["string"],"application":"string","name":"string","metadata":{"additionalProperty1":{},"additionalProperty2":{}}}}}'
Request examples
{
  "additionalProperty1": {
    "additionalProperty1": {
      "actions": [
        "string"
      ],
      "application": "string",
      "name": "string",
      "metadata": {
        "additionalProperty1": {},
        "additionalProperty2": {}
      }
    },
    "additionalProperty2": {
      "actions": [
        "string"
      ],
      "application": "string",
      "name": "string",
      "metadata": {
        "additionalProperty1": {},
        "additionalProperty2": {}
      }
    }
  },
  "additionalProperty2": {
    "additionalProperty1": {
      "actions": [
        "string"
      ],
      "application": "string",
      "name": "string",
      "metadata": {
        "additionalProperty1": {},
        "additionalProperty2": {}
      }
    },
    "additionalProperty2": {
      "actions": [
        "string"
      ],
      "application": "string",
      "name": "string",
      "metadata": {
        "additionalProperty1": {},
        "additionalProperty2": {}
      }
    }
  }
}
Response examples (200)
{
  "additionalProperty1": {
    "*": {
      "created": true
    }
  },
  "additionalProperty2": {
    "*": {
      "created": true
    }
  }
}