---
title: "Rotate Agent"
method: POST
path: "/v1/agents/{agent_id}/rotate"
tags: ["agents"]
---

# Rotate Agent

`POST /v1/agents/{agent_id}/rotate`

## Request

- Base URL: `https://api.usekeel.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.usekeel.io/v1/agents/{agent_id}/rotate`
- Auth: none declared

Rotate credential: revoke old, create new. Returns new token ONCE.

A key that is revoked or expired is refused with 409. Rotation replaces a
live credential and copies its scopes; it never brings a dead key back.

## Path parameters

- `agent_id` string, required

## Headers

- `Authorization` string, nullable
- `X-Org-Id` string, nullable

## Response `200`

Successful Response

- RotateAgentResponse
  - `id` string, required
  - `name` string, required
  - `token` string, required
  - `credential_id` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/usekeel/apis/keel-api.md) · [All operations](https://skmtc.dev/usekeel/apis/keel-api/llms.txt) · [OpenAPI document](https://skmtc.dev/usekeel/apis/keel-api/revisions/3191ca10b0ab?raw)
