---
type: api
title: Delete a Fleet Server host
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v9/operation/operation-delete-fleet-fleet-server-hosts-itemid
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana/v9/operation/operation-delete-fleet-fleet-server-hosts-itemid
products:
  - Kibana
---

# Delete a Fleet Server host

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

## Paths

- `DELETE` `/api/fleet/fleet_server_hosts/{itemId}`
- `DELETE` `/s/{space_id}/api/fleet/fleet_server_hosts/{itemId}`

#### Path parameters

- `itemId` (string) — required
  The ID of the Fleet Server host

## Description

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

Delete a Fleet Server host by ID.

## Required authorization

- Privileges: `fleet-settings-all`

## Authentication

- Api key: `Authorization: <value>`
  These APIs use key-based authentication. You must create an API key and use the encoded value in the request header. For example: `Authorization: ApiKey base64AccessApiKey`
- Basic: `Authorization: Basic <credentials>`

## Header parameters

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

## Responses

#### `200`

Successful response

`application/json`

- `id` (string)
#### `400`

Bad Request

`application/json`

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

Not Found

`application/json`

## Code examples

#### Console

```console
DELETE kbn:/api/fleet/fleet_server_hosts/ITEM_ID
```

#### curl

```curl
curl -X DELETE "${KIBANA_URL}/api/fleet/fleet_server_hosts/${ITEM_ID}" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}"
```

## Response examples

#### Delete fleet server host

The Fleet Server host was successfully deleted

```json
{
  "id": "fleet-server-host-id-1"
}
```

#### Generic error response

Example of a generic error response

```json
{
  "error": "Bad Request",
  "message": "An error message describing what went wrong",
  "statusCode": 400
}
```

#### Not found

No Fleet Server host was found with the given ID

```json
{
  "error": "Not Found",
  "message": "Fleet server fleet-server-host-id-1 not found",
  "statusCode": 404
}
```

