---
title: "Rotate Token"
method: POST
path: "/v1/agent-tokens/{token_id}/rotate"
tags: ["agent-tokens"]
---

# Rotate Token

`POST /v1/agent-tokens/{token_id}/rotate`

## Request

- Base URL: `https://api.cybret.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.cybret.ai/v1/agent-tokens/{token_id}/rotate`
- Auth: HTTP bearer

## Path parameters

- `token_id` string, required

## Request body

- RotateAgentTokenRequest: Optional new expiry. Omit the field to keep the current one.
  - `expires_at` string, date-time, nullable

## Response `200`

Successful Response

- CreatedAgentToken: One-time create response. ``token`` is returned once.
  - `token_id` string, required
  - `label` string, required
  - `token_prefix` string, nullable
  - `scopes` string[], required
  - `created_at` string, date-time, required
  - `last_used_at` string, date-time, nullable
  - `expires_at` string, date-time, nullable
  - `token` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/cybret/apis/api-scanner-control-plane.md) · [All operations](https://skmtc.dev/cybret/apis/api-scanner-control-plane/llms.txt) · [OpenAPI document](https://skmtc.dev/cybret/apis/api-scanner-control-plane/revisions/4c9b522246af?raw)
