---
type: api
title: Get incoming agent data
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-get-fleet-agent-status-data
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/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`

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

## 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.<br/><br/>[Required authorization] Route required privileges: fleet-agents-read.

## Query String Parameters

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

## Responses

#### `200`

Successful response

`application/json`

- `dataPreview` ([] object · max: 10000)
- `items` ([] string to object · max: 10000)
#### `400`

Bad Request

`application/json`

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

#### Console

```console
GET /api/fleet/agent_status/data?agentsIds={agentsIds}
```

#### curl

```curl
curl -X GET "https://{kibana_url}/api/fleet/agent_status/data?agentsIds={agentsIds}"
```

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

