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

# Get agent status summary

Authentication: required

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

## Paths

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

#### Path parameters

- `space_id` (string) — optional
  An identifier for the space. If `space_id` is not provided in the URL, the default space is used. Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

## Query string parameters

- `policyId` (string) — optional
- `kuery` (string) — optional — deprecated

## Responses

#### `200`

OK

`application/json`

- `active` (integer)
- `all` (integer)
- `error` (integer)
- `events` (integer)
- `inactive` (integer)
- `offline` (integer)
- `online` (integer)
- `other` (integer)
- `total` (integer) — deprecated
- `unenrolled` (integer)
- `updating` (integer)
#### `400`

Generic Error

`application/json`

- `error` (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

#### 200

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "active": 0,
  "all": 0,
  "error": 0,
  "events": 0,
  "inactive": 0,
  "offline": 0,
  "online": 0,
  "other": 0,
  "total": 0,
  "unenrolled": 0,
  "updating": 0
}
```

#### 400

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "error": "string",
  "message": "string",
  "statusCode": 0
}
```

