Activate a user profile Added in 8.2.0

POST /_security/profile/_activate

Create or update a user profile on behalf of another user.

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. The calling application must have either an access_token or a combination of username and password for the user that the profile document is intended for. Elastic reserves the right to change or remove this feature in future releases without prior notice.

This API creates or updates a profile document for end users with information that is extracted from the user's authentication object including username, full_name, roles, and the authentication realm. For example, in the JWT access_token case, the profile user's username is extracted from the JWT token claim pointed to by the claims.principal setting of the JWT realm that authenticated the token.

When updating a profile document, the API enables the document if it was disabled. Any updates do not change existing content for either the labels or data fields.

application/json

Body Required

  • The user's Elasticsearch access token or JWT. Both access and id JWT token types are supported and they depend on the underlying JWT realm configuration. If you specify the access_token grant type, this parameter is required. It is not valid with other grant types.

  • grant_type string Required

    Values are password or access_token.

  • password string

    The user's password. If you specify the password grant type, this parameter is required. It is not valid with other grant types.

  • username string

    The username that identifies the user. If you specify the password grant type, this parameter is required. It is not valid with other grant types.

Responses

POST /_security/profile/_activate
curl \
 --request POST http://api.example.com/_security/profile/_activate \
 --header "Content-Type: application/json" \
 --data '{"access_token":"string","grant_type":"password","password":"string","username":"string"}'
Request examples
{
  "access_token": "string",
  "grant_type": "password",
  "password": "string",
  "username": "string"
}
Response examples (200)
{
  "uid": "string",
  "user": {
    "email": "string",
    "full_name": "string",
    "realm_name": "string",
    "realm_domain": "string",
    "roles": [
      "string"
    ],
    "username": "string"
  },
  "data": {
    "additionalProperty1": {},
    "additionalProperty2": {}
  },
  "labels": {
    "additionalProperty1": {},
    "additionalProperty2": {}
  },
  "enabled": true,
  "last_synchronized": 42.0,
  "_doc": {
    "_primary_term": 42.0,
    "_seq_no": 42.0
  }
}