---
type: api
title: Get auto upgrade agent status
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/operation/operation-get-fleet-agent-policies-agentpolicyid-auto-upgrade-agents-status
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v9/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`
- `GET` `/s/{space_id}/api/fleet/agent_policies/{agentPolicyId}/auto_upgrade_agents_status`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v9/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/kibana/v9/authentication#basicauth)

#### Path Parameters

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

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Get the auto-upgrade status for agents assigned to an agent policy.<br/><br/>[Required authorization] Route required privileges: fleet-agents-read.

## Responses

#### `200`

Successful response

`application/json`

- `currentVersions` ([] object · max: 10000)
  - `agents` (number)
    Number of agents that upgraded to this version
  - `failedUpgradeActionIds` ([] string · max: 1000)
    List of action IDs related to failed upgrades
  - `failedUpgradeAgents` (number)
    Number of agents that failed to upgrade to this version
  - `inProgressUpgradeActionIds` ([] string · max: 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 /api/fleet/agent_policies/{agentPolicyId}/auto_upgrade_agents_status
```

#### curl

```curl
curl -X GET "https://{kibana_url}/api/fleet/agent_policies/{agentPolicyId}/auto_upgrade_agents_status"
```

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

