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

# Get Fleet Server hosts

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

## Paths

- `GET` `/api/fleet/fleet_server_hosts`
- `GET` `/s/{space_id}/api/fleet/fleet_server_hosts`

## Description

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

List all Fleet Server hosts.

## Required authorization

- Privileges: `fleet-agents-all` or `fleet-settings-read`

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

## Responses

#### `200`

Successful response

`application/json`

- `items` (object[] · max items: 10000)
  - `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)
- `page` (number)
- `perPage` (number)
- `total` (number)
#### `400`

Bad Request

`application/json`

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

#### Console

```console
GET kbn:/api/fleet/fleet_server_hosts
```

#### curl

```curl
curl -X GET "${KIBANA_URL}/api/fleet/fleet_server_hosts" \
  -H "Authorization: ApiKey ${API_KEY}"
```

## Response examples

#### Get fleet server hosts

List of Fleet Server hosts

```json
{
  "items": [
    {
      "host_urls": [
        "https://fleet-server.example.com:8220"
      ],
      "id": "fleet-server-host-id-1",
      "is_default": true,
      "is_preconfigured": false,
      "name": "Default Fleet Server"
    }
  ],
  "page": 1,
  "perPage": 20,
  "total": 1
}
```

#### Generic error response

Example of a generic error response

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

