---
type: api
title: Initiate Fleet setup
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/v8/operation/operation-setup
resource: https://www.elastic.co/elastic/docs-builder/docs/4641/api/doc/kibana/v8/operation/operation-setup
products:
  - Kibana
---

# Initiate Fleet setup

Authentication: required

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

## Paths

- `POST` `/api/fleet/setup`
- `POST` `/s/{space_id}/api/fleet/setup`

#### Path parameters

- `space_id` (string) — optional
  An identifier for the space. If `space_id` is not provided in the URL, the default space is used. Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

## Header parameters

- `kbn-xsrf` (string) — required
  Kibana's anti Cross-Site Request Forgery token. Can be any string value.

## Responses

#### `200`

OK

`application/json`

- `isInitialized` (boolean)
- `nonFatalErrors` (object[])
  - `message` (string)
  - `name` (string)
#### `400`

Generic Error

`application/json`

- `error` (string)
- `message` (string)
- `statusCode` (number)
#### `500`

Internal Server Error

`application/json`

- `message` (string)
## Code examples

#### Console

```console
POST kbn:/api/fleet/setup
```

#### curl

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

## Response examples

#### 200

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "isInitialized": false,
  "nonFatalErrors": [
    {
      "message": "string",
      "name": "string"
    }
  ]
}
```

#### 400

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "error": "string",
  "message": "string",
  "statusCode": 0
}
```

#### 500

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "message": "string"
}
```

