Restart an agent Experimental; added in 9.6.0

POST /api/fleet/agents/{agentId}/restart

Spaces method and path for this operation:

post /s/{space_id}/api/fleet/agents/{agentId}/restart

Refer to Spaces for more information.

Restart an Elastic Agent. The request fails when the agent is inactive, on a version earlier than 9.6.0, or enrolled in a hosted agent policy.

[Required authorization] Route required privileges: fleet-agents-all.

Headers

  • kbn-xsrf string Required

    A required header to protect against CSRF attacks

Path parameters

  • agentId string Required

    The agent ID to restart

    Maximum length is 512.

Responses

  • 200 application/json

    OK: A successful request.

    Any of:
  • 400 application/json

    A bad request.

    Hide response attributes Show response attributes object
    • attributes Required
    • error string
    • errorType string
    • message string Required
    • statusCode number
POST /api/fleet/agents/{agentId}/restart
curl \
 --request POST 'https://localhost:5601/api/fleet/agents/{agentId}/restart' \
 --header "Authorization: $API_KEY" \
 --header "kbn-xsrf: true"
Response examples (200)
{
  "actionId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
Response examples (400)
{
  "message": "Bad Request"
}