---
type: api
title: Bulk rollback agents
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-post-fleet-agents-bulk-rollback
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-post-fleet-agents-bulk-rollback
products:
  - Kibana
---

# Bulk rollback agents

Availability:

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

## Paths

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

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

## Description

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

Rollback multiple agents to the previous version.<br/><br/>[Required authorization] Route required privileges: fleet-agents-all.

## Request Body

`application/json`

- `agents` (union [] string | string) — required
- `batchSize` (number) — optional
- `dryRun` (boolean) — optional
- `includeInactive` (boolean · default: false) — optional

## Responses

#### `200`

OK: A successful request.

`application/json`

Any of:
- **{ actionIds }**
  - `actionIds` ([] string · max: 10000)
- **{ count }**
  - `count` (number)
#### `400`

A bad request.

`application/json`

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

#### Console

```console
POST /api/fleet/agents/bulk_rollback
{
  "agents": [
    "agent-1",
    "agent-2"
  ],
  "batchSize": 100,
  "includeInactive": false
}
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/fleet/agents/bulk_rollback" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{
  "agents": [
    "agent-1",
    "agent-2"
  ],
  "batchSize": 100,
  "includeInactive": false
}'
```

## Response Examples

#### Success

```json
{
  "actionIds": [
    "actionId1",
    "actionId2"
  ]
}
```

#### Bad request

```json
{
  "message": "Bad Request"
}
```

