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

# Bulk rollback agents

Availability: Experimental

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

## Paths

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

## Description

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

Rollback multiple agents to the previous version.

## Required authorization

- Privileges: `fleet-agents-all`

## Authentication

- Api key: `Authorization: <value>`
  You must create an API key and use the encoded value in the request header. To learn about creating keys, go to [API keys](https://www.elastic.co/docs/current/serverless/api-keys).

## Header parameters

- `kbn-xsrf` (string) — required
  A required header to protect against CSRF attacks

## 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 items: 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 kbn:/api/fleet/agents/bulk_rollback
{
  "agents": [
    "agent-1",
    "agent-2"
  ],
  "batchSize": 100,
  "includeInactive": false
}
```

#### curl

```curl
curl -X POST "${KIBANA_URL}/api/fleet/agents/bulk_rollback" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -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"
}
```

