---
type: api
title: Enable the history snapshot task
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/operation/operation-put-security-entity-store-history-snapshot-enable
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/operation/operation-put-security-entity-store-history-snapshot-enable
products:
  - Kibana
---

# Enable the history snapshot task

Authentication: required

Availability: Planned

- Server: `https://{kibana_url}`

## Paths

- `PUT` `/api/security/entity_store/history_snapshot/enable`
- `PUT` `/s/{space_id}/api/security/entity_store/history_snapshot/enable`

#### Path parameters

- `space_id` (string) — optional
  An identifier for the space. If `space_id` is not provided in the URL, the default space is used. Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

## Description

Enable the Entity Store history snapshot task for this space. After a successful enable, Kibana schedules an immediate snapshot run. If that immediate run fails, the response is still 200 and the task remains enabled for the next scheduled interval. If the task is already enabled, the request succeeds and does not start an extra run. Returns 404 if the Entity Store is not installed in the current space.

## Required authorization

- Privileges: `securitySolution`

## Header parameters

- `kbn-xsrf` (string) — required
  A required header to protect against CSRF attacks

## Responses

#### `200`

Indicates a successful response.

`application/json`

#### `404`

Entity store is not installed.

`application/json`

## Code examples

#### Console

```console
PUT kbn://api/security/entity_store/history_snapshot/enable
```

#### curl

```curl
curl -X PUT -H "kbn-xsrf: true" -H "Authorization: ApiKey ${API_KEY}" \
  "${KIBANA_URL}/api/security/entity_store/history_snapshot/enable"
```

## Response examples

#### History snapshot task enabled

`application/json`

The Entity Store history snapshot task was enabled.

```json
{
  "ok": true
}
```

#### Entity store not installed

`application/json`

The Entity Store history snapshot task cannot be enabled because the entity store is not installed.

```json
{
  "error": "Not Found",
  "message": "Entity store is not installed",
  "statusCode": 404
}
```

