---
type: api
title: List agents by action ids
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-get-agents-by-actions
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/v8/operation/operation-get-agents-by-actions
products:
  - Kibana
---

# List agents by action ids

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

## Paths

- `POST` `/api/fleet/agents`
- `POST` `/s/{space_id}/api/fleet/agents`

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

## Description

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

## Request Body

`application/json`

- `actionIds` ([] string) — optional

## Responses

#### `200`

OK

`application/json`

Type: `[] object`

#### `400`

Generic Error

`application/json`

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

#### Console

```console
POST /api/fleet/agents
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/fleet/agents" \
  -H "kbn-xsrf: true"
```

