POST /api/fleet/setup

Spaces method and path for this operation:

post /s/{space_id}/api/fleet/setup

Refer to Spaces for more information.

Initialize Fleet and create the necessary Elasticsearch resources for Fleet to operate. Safe to call multiple times (idempotent). Returns the initialization status and any non-fatal errors encountered during setup.

[Required authorization] Route required privileges: fleet-agents-read OR fleet-agent-policies-read OR fleet-settings-read OR fleet-setup.

Headers

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

Responses

  • 200 application/json

    Fleet setup completed

    Hide response attributes Show response attributes object
    • isInitialized boolean Required
    • nonFatalErrors array[object] Required

      Not more than 10000 elements.

      Hide nonFatalErrors attributes Show nonFatalErrors attributes object
      • message string Required
      • name string Required
  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • attributes Required
    • error string
    • errorType string
    • message string Required
    • statusCode number
  • 500 application/json

    Internal Server Error

    Hide response attribute Show response attribute object
    • message string Required
POST /api/fleet/setup
curl \
 --request POST 'https://<KIBANA_URL>/api/fleet/setup' \
 --header "Authorization: $API_KEY" \
 --header "kbn-xsrf: true"
Response examples (200)
Fleet initialized successfully with no non-fatal errors
{
  "isInitialized": true,
  "nonFatalErrors": []
}
Fleet initialized but encountered non-fatal errors during setup
{
  "isInitialized": true,
  "nonFatalErrors": [
    {
      "message": "Package fleet_server not found in registry",
      "name": "PackageNotFoundError"
    }
  ]
}
Response examples (400)
Example of a generic error response
{
  "error": "Bad Request",
  "message": "An error message describing what went wrong",
  "statusCode": 400
}
Response examples (500)
Example of an internal server error response
{
  "error": "Internal Server Error",
  "message": "An error message describing what went wrong",
  "statusCode": 500
}