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

# Get the autoscaling capacity

Availability: 7.11+

## Paths

- `GET` `/_autoscaling/capacity`

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

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

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

- `policies` (map string to AutoscalingDeciders)
  Map values ({} AutoscalingDeciders)
  - `required_capacity` ({} AutoscalingCapacity)
    - `node` ({} AutoscalingResources)
      - `storage` (number)
      - `memory` (number)
    - `total` ({} AutoscalingResources)
      - `storage` (number)
      - `memory` (number)
  - `current_capacity` ({} AutoscalingCapacity)
    - `node` ({} AutoscalingResources)
      - `storage` (number)
      - `memory` (number)
    - `total` ({} AutoscalingResources)
      - `storage` (number)
      - `memory` (number)
  - `current_nodes` ([] AutoscalingNode)
    - `name` (string)
  - `deciders` (map string to AutoscalingDecider)
    Map values ({} AutoscalingDecider)
    - `required_capacity` ({} AutoscalingCapacity)
      - `node` ({} AutoscalingResources)
        - `storage` (number)
        - `memory` (number)
      - `total` ({} AutoscalingResources)
        - `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: {}
}
```

