---
type: api
title: Get auto upgrade agent status
description: Get the auto-upgrade status for agents assigned to an agent policy.<br/><br/>[Required authorization] Route required privileges: fleet-agents-read.
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-get-fleet-agent-policies-agentpolicyid-auto-upgrade-agents-status
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v0/operation/operation-get-fleet-agent-policies-agentpolicyid-auto-upgrade-agents-status
products:
  - Kibana
---

# Get auto upgrade agent status

- Server: `https://{kibana_url}`

## Paths

- `GET` `/api/fleet/agent_policies/{agentPolicyId}/auto_upgrade_agents_status`

#### Path parameters

- `agentPolicyId` (string) — required
  The ID of the agent policy

## Description

Get the auto-upgrade status for agents assigned to an agent policy.

## Required authorization

- Privileges: `fleet-agents-read`

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Responses

#### `200`

Successful response

`application/json`

- `currentVersions` (object[] · max items: 10000)
  - `agents` (number)
    Number of agents that upgraded to this version
  - `failedUpgradeActionIds` (string[] · max items: 1000)
    List of action IDs related to failed upgrades
  - `failedUpgradeAgents` (number)
    Number of agents that failed to upgrade to this version
  - `inProgressUpgradeActionIds` (string[] · max items: 1000)
    List of action IDs related to in-progress upgrades
  - `inProgressUpgradeAgents` (number)
    Number of agents that are upgrading to this version
  - `version` (string)
    Agent version
- `totalAgents` (number)
#### `400`

Bad Request

`application/json`

- `attributes` (object)
- `error` (string)
- `errorType` (string)
- `message` (string)
- `statusCode` (number)
## Code examples

#### Console

```console
GET kbn:/api/fleet/agent_policies/AGENT_POLICY_ID/auto_upgrade_agents_status
```

#### curl

```curl
curl -X GET "${KIBANA_URL}/api/fleet/agent_policies/${AGENT_POLICY_ID}/auto_upgrade_agents_status" \
  -H "Authorization: ApiKey ${API_KEY}"
```

## Response examples

#### Get auto upgrade agents status

Auto-upgrade status for agents in the policy

```json
{
  "agentsCount": 5,
  "currentVersion": "8.16.0",
  "failedAgentsCount": 0,
  "upgradedAgentsCount": 3,
  "upgradingAgentsCount": 1
}
```

#### Generic error response

Example of a generic error response

```json
{
  "error": "Bad Request",
  "message": "An error message describing what went wrong",
  "statusCode": 400
}
```

