---
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/4493/api/doc/elasticsearch/v8/operation/operation-autoscaling-get-autoscaling-policy
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/elasticsearch/v8/operation/operation-autoscaling-get-autoscaling-policy
products:
  - Elasticsearch
---

# Get an autoscaling policy

Availability: Generally available since 7.11

## Paths

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

#### Path parameters

- `name` (string) — required
  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)

## Authentication

- Api key: `Authorization: <value>`
  Elasticsearch APIs support key-based authentication.
  You must create an API key and use the encoded value in the request header.
  For example:
  
  
  ```
  curl -X GET "${ES_URL}/_cat/indices?v=true" \
    -H "Authorization: ApiKey ${API_KEY}"
  ```
  
  To get API keys, use the `/_security/api_key` APIs.
- Basic: `Authorization: Basic <credentials>`
- Bearer: `Authorization: Bearer <token>`
  Elasticsearch APIs support the use of bearer tokens in the `Authorization` HTTP header to authenticate with the API.
  For examples, refer to [Token-based authentication services](https://www.elastic.co/guide/en/elasticsearch/reference/current/token-authentication-services.html)

## Query string parameters

- `master_timeout` (string · default: 30s) — optional
  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>
}
```

