---
type: api
title: Bulk restart 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-restart
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-post-fleet-agents-bulk-restart
products:
  - Kibana
---

# Bulk restart agents

Availability:

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

## Paths

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

- [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.

Restart multiple Elastic Agents. Agents that are enrolled in a hosted policy or are on a version earlier than 9.6.0 are excluded from the action and receive individual error results.<br/><br/>[Required authorization] Route required privileges: fleet-agents-all.

## Request Body

`application/json`

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

## Responses

#### `200`

OK: A successful request.

`application/json`

Any of:
- **Kibana_HTTP_APIs_action_id_response**
  - `actionId` (string)
- **Kibana_HTTP_APIs_action_message_response**
  - `message` (string)
#### `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_restart
{
  "agents": [
    "agent-1",
    "agent-2"
  ],
  "batchSize": 100,
  "includeInactive": false
}
```

#### curl

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

## Response Examples

#### Success

```json
{
  "actionId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
```

#### Bad request

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

