Update user profile data Added in 8.2.0

PUT /_security/profile/{uid}/_data

Update specific data for the user profile that is associated with a unique ID.

NOTE: The user profile feature is designed only for use by Kibana and Elastic's Observability, Enterprise Search, and Elastic Security solutions. Individual users and external applications should not call this API directly. Elastic reserves the right to change or remove this feature in future releases without prior notice.

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

  • The manage_user_profile cluster privilege.
  • The update_profile_data global privilege for the namespaces that are referenced in the request.

This API updates the labels and data fields of an existing user profile document with JSON objects. New keys and their values are added to the profile document and conflicting keys are replaced by data that's included in the request.

For both labels and data, content is namespaced by the top-level fields. The update_profile_data global privilege grants privileges for updating only the allowed namespaces.

Path parameters

  • uid string Required

    A unique identifier for the user profile.

Query parameters

  • Only perform the operation if the document has this sequence number.

  • Only perform the operation if the document has this primary term.

  • refresh string

    If 'true', Elasticsearch refreshes the affected shards to make this operation visible to search. If 'wait_for', it waits for a refresh to make this operation visible to search. If 'false', nothing is done with refreshes.

    Values are true, false, or wait_for.

application/json

Body Required

  • labels object

    Searchable data that you want to associate with the user profile. This field supports a nested data structure. Within the labels object, top-level keys cannot begin with an underscore (_) or contain a period (.).

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

      Additional properties are allowed.

  • data object

    Non-searchable data that you want to associate with the user profile. This field supports a nested data structure. Within the data object, top-level keys cannot begin with an underscore (_) or contain a period (.). The data object is not searchable, but can be retrieved with the get user profile API.

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

      Additional properties are allowed.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • acknowledged boolean Required

      For a successful response, this value is always true. On failure, an exception is returned instead.

PUT /_security/profile/{uid}/_data
curl \
 --request PUT http://api.example.com/_security/profile/{uid}/_data \
 --header "Content-Type: application/json" \
 --data '{"labels":{"additionalProperty1":{},"additionalProperty2":{}},"data":{"additionalProperty1":{},"additionalProperty2":{}}}'
Request examples
{
  "labels": {
    "additionalProperty1": {},
    "additionalProperty2": {}
  },
  "data": {
    "additionalProperty1": {},
    "additionalProperty2": {}
  }
}
Response examples (200)
{
  "acknowledged": true
}