---
type: api
title: Get an agent status summary
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v9/operation/operation-get-fleet-agent-status
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v9/operation/operation-get-fleet-agent-status
products:
  - Kibana
---

# Get an agent status summary

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

## Paths

- `GET` `/api/fleet/agent_status`
- `GET` `/s/{space_id}/api/fleet/agent_status`

## Description

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

Get a summary of agent statuses for a given agent policy.

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

## Query string parameters

- `policyId` (string) — optional
  Filter by agent policy ID
- `policyIds` (string[] · max items: 1000) — optional
  Filter by one or more agent policy IDs
- `kuery` (string) — optional
  A KQL query string to filter results

## Responses

#### `200`

Successful response

`application/json`

- `results` (object)
  - `active` (number)
  - `all` (number)
  - `error` (number)
  - `events` (number)
  - `inactive` (number)
  - `offline` (number)
  - `online` (number)
  - `orphaned` (number)
  - `other` (number)
  - `unenrolled` (number)
  - `uninstalled` (number)
  - `updating` (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_status
```

#### curl

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

## Response examples

#### Get agent status

Agent status summary for an agent policy

```json
{
  "results": {
    "error": 1,
    "offline": 2,
    "online": 5,
    "other": 0,
    "updating": 0
  },
  "totalInactive": 0
}
```

#### Generic error response

Example of a generic error response

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

