---
type: api
title: Get an agent action status
description: Get the current status of recent agent actions.<br/><br/>[Required authorization] Route required privileges: fleet-agents-read.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-get-fleet-agents-action-status
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v0/operation/operation-get-fleet-agents-action-status
products:
  - Kibana
---

# Get an agent action status

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

## Paths

- `GET` `/api/fleet/agents/action_status`

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

## Description

Get the current status of recent agent actions.<br/><br/>[Required authorization] Route required privileges: fleet-agents-read.

## Query String Parameters

- `page` (number · default: 0)
  Page number
- `perPage` (number · default: 20)
  Number of results per page
- `date` (string)
  Return actions created before this date
- `latest` (number)
  Return only the latest N actions
- `scheduledOnly` (boolean)
  Return only actions whose start_time is in the future
- `errorSize` (number · default: 5)
  Number of error details to include per action

## Responses

#### `200`

Successful response

`application/json`

- `items` ([] object · max: 10000)
  - `actionId` (string)
  - `cancellationTime` (string)
  - `completionTime` (string)
  - `creationTime` (string)
    creation time of action
  - `expiration` (string)
  - `hasRolloutPeriod` (boolean)
  - `is_automatic` (boolean)
  - `latestErrors` ([] object · max: 10)
    - `agentId` (string)
    - `error` (string)
    - `hostname` (string)
    - `timestamp` (string)
  - `nbAgentsAck` (number)
    number of agents that acknowledged the action
  - `nbAgentsActionCreated` (number)
    number of agents included in action from kibana
  - `nbAgentsActioned` (number)
    number of agents actioned
  - `nbAgentsFailed` (number)
    number of agents that failed to execute the action
  - `newPolicyId` (string)
    new policy id (POLICY_REASSIGN action)
  - `policyId` (string)
    policy id (POLICY_CHANGE action)
  - `revision` (number)
    new policy revision (POLICY_CHANGE action)
  - `startTime` (string)
    start time of action (scheduled actions)
  - `status` (enum)
    Values: `COMPLETE`, `EXPIRED`, `CANCELLED`, `FAILED`, `IN_PROGRESS`, `ROLLOUT_PASSED`
  - `type` (enum)
    Values: `UPGRADE`, `UNENROLL`, `SETTINGS`, `POLICY_REASSIGN`, `CANCEL`, `FORCE_UNENROLL`, `REQUEST_DIAGNOSTICS`, `UPDATE_TAGS`, `POLICY_CHANGE`, `INPUT_ACTION`, `MIGRATE`, `PRIVILEGE_LEVEL_CHANGE`, `ROLLBACK`, `REMOVE_COLLECTOR`
  - `version` (string)
    agent version number (UPGRADE action)
#### `400`

Bad Request

`application/json`

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

#### Console

```console
GET /api/fleet/agents/action_status
```

#### curl

```curl
curl -X GET "https://{kibana_url}/api/fleet/agents/action_status"
```

## Response Examples

#### Get action status

Status of recent agent actions

```json
{
  "items": [
    {
      "actionId": "action-id-1",
      "completionTime": "2024-01-01T00:05:00.000Z",
      "creationTime": "2024-01-01T00:00:00.000Z",
      "nbAgentsAck": 2,
      "nbAgentsActioned": 2,
      "nbAgentsFailed": 0,
      "status": "COMPLETE",
      "type": "UPGRADE"
    }
  ]
}
```

#### Generic error response

Example of a generic error response

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

