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

Spaces method and path for this operation:

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

Refer to Spaces for more information.

Reassign an agent to a different 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
application/json

Body

  • policy_id string Required

Responses

  • 200 application/json

    Successful response

    Additional properties are NOT allowed.

  • 400 application/json

    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}/reassign
curl \
 --request POST 'https://<KIBANA_URL>/api/fleet/agents/{agentId}/reassign' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --header "kbn-xsrf: true" \
 --data '{"policy_id":"agent-policy-id-2"}'
Request example
Reassign an agent to a different policy
{
  "policy_id": "agent-policy-id-2"
}
Response examples (200)
Agent successfully reassigned
{
  "description": "Agent successfully reassigned",
  "value": {}
}
Response examples (400)
Example of a generic error response
{
  "error": "Bad Request",
  "message": "An error message describing what went wrong",
  "statusCode": 400
}