PUT /api/security/entity_store/entities/bulk

Spaces method and path for this operation:

put /s/{space_id}/api/security/entity_store/entities/bulk

Refer to Spaces for more information.

Update multiple entity records in the Entity Store in a single request.

[Required authorization] Route required privileges: securitySolution.

Headers

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

Query parameters

  • force string | boolean

    When true, allows updating protected fields.

    Values are true or false. Default value is false.

application/json

Body

  • entities array[object] Required

    The entities to update.

    Hide entities attributes Show entities attributes object
    • doc object Required

      Any of:
    • type string Required

      The entity type of this record.

      Values are user, host, service, or generic.

Responses

  • 200 application/json

    Indicates a successful response.

  • 400 application/json

    Bad request.

PUT /api/security/entity_store/entities/bulk
curl -X PUT -H "kbn-xsrf: true" -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"entities":[{"type":"host","doc":{"entity":{"id":"host:web-server-prod-01","name":"web-server-prod-01","type":"host","attributes":{"asset":true}},"host":{"name":"web-server-prod-01"}}}]}' \
  "${KIBANA_URL}/api/security/entity_store/entities/bulk?force=true"
PUT kbn://api/security/entity_store/entities/bulk?force=true
{
  "entities": [
    {
      "type": "host",
      "doc": {
        "entity": {
          "id": "host:web-server-prod-01",
          "name": "web-server-prod-01",
          "type": "host",
          "attributes": { "asset": true }
        },
        "host": { "name": "web-server-prod-01" }
      }
    }
  ]
}
Request example
Update a host entity and a user entity in a single request.
{
  "entities": [
    {
      "doc": {
        "entity": {
          "attributes": {
            "asset": true
          },
          "id": "host:web-server-prod-01",
          "name": "web-server-prod-01",
          "type": "host"
        },
        "host": {
          "name": "web-server-prod-01"
        }
      },
      "type": "host"
    },
    {
      "doc": {
        "entity": {
          "attributes": {
            "managed": true
          },
          "id": "user:jane.doe@example.com",
          "name": "jane.doe",
          "type": "user"
        },
        "user": {
          "name": "jane.doe"
        }
      },
      "type": "user"
    }
  ]
}
Response examples (200)
Some entities were updated but others encountered Elasticsearch-level errors.
{
  "errors": [
    {
      "_id": "5de9f93a68a72532e736bf5a6184b06300b9cabf",
      "reason": "[5de9f93a68a72532e736bf5a6184b06300b9cabf]: document missing",
      "status": 404,
      "type": "document_missing_exception"
    }
  ],
  "ok": true
}
All entities were successfully updated with no errors.
{
  "errors": [],
  "ok": true
}
Response examples (400)
The request attempts to update protected fields without the force query parameter.
{
  "error": "Bad Request",
  "message": "Bad request: The following attributes are not allowed to be updated without forcing it (?force=true): entity.name, entity.type",
  "statusCode": 400
}