---
title: "Rotate an uninstall token"
method: POST
path: "/api/fleet/uninstall_tokens/{agentPolicyId}/rotate"
tags: ["Fleet uninstall tokens"]
---

# Rotate an uninstall token

`POST /api/fleet/uninstall_tokens/{agentPolicyId}/rotate`

**Spaces method and path for this operation:**

<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/fleet/uninstall_tokens/{agentPolicyId}/rotate</span></div>

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Rotate the uninstall token for an agent policy. Only applicable to policies with tamper protection enabled.<br/><br/>[Required authorization] Route required privileges: fleet-agents-all.

## Path parameters

- `agentPolicyId` string, required

## Headers

- `kbn-xsrf` string, required

## Response `200`

Successful response

- object
  - `message` string, required

## Other responses

- `400` — Bad Request
- `404` — Not Found

---

[API](https://skmtc.net/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.net/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/kibana-apis/revisions/93e11b266872/schema)
