Spaces method and path for this operation:
post /s/{space_id}/api/fleet/uninstall_tokens/{agentPolicyId}/rotate
Refer to Spaces for more information.
Rotate the uninstall token for an agent policy. Only applicable to policies with tamper protection enabled.
[Required authorization] Route required privileges: fleet-agents-all.
POST
/api/fleet/uninstall_tokens/{agentPolicyId}/rotate
curl \
--request POST 'https://localhost:5601/api/fleet/uninstall_tokens/{agentPolicyId}/rotate' \
--header "Authorization: $API_KEY" \
--header "kbn-xsrf: true"
Response examples (200)
Uninstall token rotated successfully for the given agent policy
{
"message": "Uninstall token rotated successfully."
}
Response examples (400)
Generic error response example
Example of a generic error response
{
"error": "Bad Request",
"message": "An error message describing what went wrong",
"statusCode": 400
}
Agent policy does not have tamper protection enabled
{
"error": "Bad Request",
"message": "Agent policy [policy-id-1] does not have tamper protection enabled. Uninstall tokens can only be rotated for protected policies.",
"statusCode": 400
}
Response examples (404)
No agent policy was found with the given ID
{
"error": "Not Found",
"message": "Agent policy not found with id policy-id-1",
"statusCode": 404
}