---
type: api
title: Update 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-serverless/operation/operation-put-fleet-fleet-server-hosts-itemid
resource: https://www.elastic.co/elastic/docs-builder/docs/4493/api/doc/kibana-serverless/operation/operation-put-fleet-fleet-server-hosts-itemid
products:
  - Kibana
---

# Update a Fleet Server host

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

## Paths

- `PUT` `/api/fleet/fleet_server_hosts/{itemId}`
- `PUT` `/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.

Update a Fleet Server host by ID.

## Required authorization

- Privileges: `fleet-settings-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`

- `allow_edit` (string[] · max items: 100) — optional
- `host_urls` (string[] · min items: 1 · max items: 10) — optional
- `is_default` (boolean) — optional
- `is_internal` (boolean) — optional
- `name` (string) — optional
- `proxy_id` (string · default: null) — optional — nullable
- `secrets` (object) — optional
  - `ssl` (object) — optional
    - `agent_key` (union anyOf) — optional
      - **{ id }**
        - `id` (string) — required
      - **string**
    - `es_key` (union anyOf) — optional
      - **{ id }**
        - `id` (string) — required
      - **string**
    - `key` (union anyOf) — optional
      - **{ id }**
        - `id` (string) — required
      - **string**
- `ssl` (object) — optional — nullable
  - `agent_certificate` (string) — optional
  - `agent_certificate_authorities` (string[] · max items: 10) — optional
  - `agent_key` (string) — optional
  - `certificate` (string) — optional
  - `certificate_authorities` (string[] · max items: 10) — optional
  - `client_auth` (enum) — optional
    Values: `optional`, `required`, `none`
  - `es_certificate` (string) — optional
  - `es_certificate_authorities` (string[] · max items: 10) — optional
  - `es_key` (string) — optional
  - `key` (string) — optional

## Responses

#### `200`

Successful response

`application/json`

- `item` (object)
  - `allow_edit` (string[] · max items: 100)
  - `host_urls` (string[] · min items: 1 · max items: 10)
  - `id` (string)
  - `is_default` (boolean · default: false)
  - `is_internal` (boolean)
  - `is_preconfigured` (boolean · default: false)
  - `name` (string)
  - `proxy_id` (string) — nullable
  - `secrets` (object)
    - `ssl` (object)
      - `agent_key` (union anyOf)
        - **{ id }**
          - `id` (string)
        - **string**
      - `es_key` (union anyOf)
        - **{ id }**
          - `id` (string)
        - **string**
      - `key` (union anyOf)
        - **{ id }**
          - `id` (string)
        - **string**
  - `ssl` (object) — nullable
    - `agent_certificate` (string)
    - `agent_certificate_authorities` (string[] · max items: 10)
    - `agent_key` (string)
    - `certificate` (string)
    - `certificate_authorities` (string[] · max items: 10)
    - `client_auth` (enum)
      Values: `optional`, `required`, `none`
    - `es_certificate` (string)
    - `es_certificate_authorities` (string[] · max items: 10)
    - `es_key` (string)
    - `key` (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
PUT kbn:/api/fleet/fleet_server_hosts/ITEM_ID
{
  "host_urls": [
    "https://updated-fleet-server.example.com:8220"
  ],
  "is_default": false,
  "name": "Updated Fleet Server"
}
```

#### curl

```curl
curl -X PUT "${KIBANA_URL}/api/fleet/fleet_server_hosts/${ITEM_ID}" \
  -H "kbn-xsrf: true" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "host_urls": [
      "https://updated-fleet-server.example.com:8220"
    ],
    "is_default": false,
    "name": "Updated Fleet Server"
  }'
```

## Response examples

#### Put fleet server host

The updated Fleet Server host

```json
{
  "item": {
    "host_urls": [
      "https://updated-fleet-server.example.com:8220"
    ],
    "id": "fleet-server-host-id-1",
    "is_default": false,
    "is_preconfigured": false,
    "name": "Updated Fleet Server"
  }
}
```

#### 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
}
```

