---
type: api
title: Get policy information
description: **All methods and paths for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-slm-get-lifecycle
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/operation/operation-slm-get-lifecycle
products:
  - Elasticsearch
---

# Get policy information


Availability: 7.4+

## Paths

- `GET` `/_slm/policy/{policy_id}`
- `GET` `/_slm/policy`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/authentication#bearerauth)

#### Path Parameters

- `policy_id` (union Name | [] Name) — optional, leave it out to use `/_slm/policy`
  A comma-separated list of snapshot lifecycle policy identifiers.

## Description

Get snapshot lifecycle policy definitions and information about the latest snapshot attempts.

## Required authorization

* Cluster privileges: `manage_slm`

## Query String Parameters

- `master_timeout` (string Duration · default: 30s)
  The period to wait for a connection to the master node.
If no response is received before the timeout expires, the request fails and returns an error.
- `timeout` (string Duration · default: 30s)
  The period to wait for a response.
If no response is received before the timeout expires, the request fails and returns an error.

## Response

`application/json`

Type: `map string to SnapshotLifecycle`

## Code Examples

#### Console

```console
GET _slm/policy/daily-snapshots?human
```

#### JavaScript

```javascript
const response = await client.slm.getLifecycle({
  policy_id: "daily-snapshots",
  human: "true",
});
```

#### Python

```python
resp = client.slm.get_lifecycle(
    policy_id="daily-snapshots",
    human=True,
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_slm/policy/daily-snapshots?human" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.slm().getLifecycle(g -> g
    .policyId("daily-snapshots")
);
```

#### C#

```c#
var response = await client.SnapshotLifecycleManagement
    .GetLifecycleAsync(d1 => d1
        .PolicyId(new[] { "daily-snapshots" })
    );
```

#### PHP

```php
$resp = $client->slm()->getLifecycle([
    "policy_id" => "daily-snapshots",
    "human" => "true",
]);
```

#### Ruby

```ruby
response = client.slm.get_lifecycle(
  policy_id: "daily-snapshots",
  human: "true"
)
```

## Response Examples

#### Get snapshot lifecycle response example1

A successful response from `GET _slm/policy/daily-snapshots?human`.

```json
{
  "daily-snapshots": {
    "version": 1,
    "modified_date": "2099-05-06T01:30:00.000Z",
    "modified_date_millis": 4081757400000,
    "policy" : {
      "schedule": "0 30 1 * * ?",
      "name": "<daily-snap-{now/d}>",
      "repository": "my_repository",
      "config": {
        "indices": ["data-*", "important"],
        "ignore_unavailable": false,
        "include_global_state": false
      },
      "retention": {
        "expire_after": "30d",
        "min_count": 5,
        "max_count": 50
      }
    },
    "stats": {
      "policy": "daily-snapshots",
      "snapshots_taken": 0,
      "snapshots_failed": 0,
      "snapshots_deleted": 0,
      "snapshot_deletion_failures": 0
    },
    "next_execution": "2099-05-07T01:30:00.000Z",
    "next_execution_millis": 4081843800000
  }
}
```

