---
type: api
title: Get incoming agent data
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-data
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v9/operation/operation-get-fleet-agent-status-data
products:
  - Kibana
---

# Get incoming agent data

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

## Paths

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

## Description

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

Get the data streams that an agent is actively sending data to.

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

## Query string parameters

- `agentsIds` (string[] · max items: 10000) — required
  Agent IDs to check data for, as an array or comma-separated string
- `pkgName` (string) — optional
  Filter by integration package name
- `pkgVersion` (string) — optional
  Filter by integration package version
- `previewData` (boolean · default: false) — optional
  When true, return a preview of the ingested data

## Responses

#### `200`

Successful response

`application/json`

- `dataPreview` (object[] · max items: 10000)
- `items` (string to object[] · max items: 10000)
#### `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/data?agentsIds=AGENTS_IDS
```

#### curl

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

## Response examples

#### Get agent data

Data streams the agent is actively sending data to

```json
{
  "items": [
    {
      "data": {
        "logs-nginx.access-default": [
          {
            "id": "agent-id-1",
            "name": "my-host"
          }
        ]
      }
    }
  ],
  "total": 1,
  "totalMonitoring": 0
}
```

#### Generic error response

Example of a generic error response

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

