---
type: api
title: Get an autoscaling policy
description: NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-autoscaling-get-autoscaling-policy
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v8/operation/operation-autoscaling-get-autoscaling-policy
products:
  - Elasticsearch
---

# Get an autoscaling policy

Availability: 7.11+

## Paths

- `GET` `/_autoscaling/policy/{name}`

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

#### Path Parameters

- `name` (string Name)
  Name of the autoscaling policy

## Description

NOTE: This feature is designed for indirect use by Elasticsearch Service, Elastic Cloud Enterprise, and Elastic Cloud on Kubernetes. Direct use is not supported.

[Read the reference documentation](https://www.elastic.co/guide/en/cloud/current/ec-autoscaling.html)

## Query String Parameters

- `master_timeout` (string Duration · default: 30s)
  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.

## Response

`application/json`

- `roles` ([] string)
- `deciders` (map string to object)
  Decider settings.
## Code Examples

#### Console

```console
GET /_autoscaling/policy/my_autoscaling_policy
```

#### JavaScript

```javascript
const response = await client.autoscaling.getAutoscalingPolicy({
  name: "my_autoscaling_policy",
});
```

#### Python

```python
resp = client.autoscaling.get_autoscaling_policy(
    name="my_autoscaling_policy",
)
```

#### curl

```curl
curl -X GET "$ELASTICSEARCH_URL/_autoscaling/policy/my_autoscaling_policy" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY"
```

#### Java

```java
client.autoscaling().getAutoscalingPolicy(g -> g
    .name("my_autoscaling_policy")
);
```

#### PHP

```php
$resp = $client->autoscaling()->getAutoscalingPolicy([
    "name" => "my_autoscaling_policy",
]);
```

#### Ruby

```ruby
response = client.perform_request(
  "GET",
  "/_autoscaling/policy/my_autoscaling_policy",
  {},
)
```

## Response Examples

#### A successful response for retrieving an autoscaling policy.

This may be a response to `GET /_autoscaling/policy/my_autoscaling_policy`.

```json
{
   "roles": <roles>,
   "deciders": <deciders>
}
```

