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

# Get the autoscaling capacity

Availability: Generally available since 7.11

## Paths

- `GET` `/_autoscaling/capacity`

## 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.

This API gets the current autoscaling capacity based on the configured autoscaling policy.
It will return information to size the cluster appropriately to the current workload.

The `required_capacity` is calculated as the maximum of the `required_capacity` result of all individual deciders that are enabled for the policy.

The operator should verify that the `current_nodes` match the operator’s knowledge of the cluster to avoid making autoscaling decisions based on stale or incomplete information.

The response contains decider-specific information you can use to diagnose how and why autoscaling determined a certain capacity was required.
This information is provided for diagnosis only.
Do not use this information to make autoscaling decisions.

[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`

- `policies` (map string to object)
  Map values (object)
  - `required_capacity` (object)
    - `node` (object)
      - `storage` (number)
      - `memory` (number)
    - `total` (object)
      - `storage` (number)
      - `memory` (number)
  - `current_capacity` (object)
    - `node` (object)
      - `storage` (number)
      - `memory` (number)
    - `total` (object)
      - `storage` (number)
      - `memory` (number)
  - `current_nodes` (object[])
    - `name` (string)
  - `deciders` (map string to object)
    Map values (object)
    - `required_capacity` (object)
      - `node` (object)
        - `storage` (number)
        - `memory` (number)
      - `total` (object)
        - `storage` (number)
        - `memory` (number)
    - `reason_summary` (string)
    - `reason_details` (object)
## Code examples

#### Console

```console
GET /_autoscaling/capacity
```

#### JavaScript

```javascript
const response = await client.autoscaling.getAutoscalingCapacity();
```

#### Python

```python
resp = client.autoscaling.get_autoscaling_capacity()
```

#### curl

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

#### Java

```java
client.autoscaling().getAutoscalingCapacity(g -> g);
```

#### PHP

```php
$resp = $client->autoscaling()->getAutoscalingCapacity();
```

#### Ruby

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

## Response examples

#### A successful response for retrieving the current autoscaling capacity.

This may be a response to `GET /_autoscaling/capacity`.

```json
{
  policies: {}
}
```

