---
title: "Mint a new default agent token; the old one stays valid until disabled"
method: POST
path: "/api/{org_id}/synthetics/agent-tokens/rotate"
tags: ["Synthetics"]
---

# Mint a new default agent token; the old one stays valid until disabled

`POST /api/{org_id}/synthetics/agent-tokens/rotate`

## Request

- Base URL: `https://api.openobserve.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.openobserve.ai/api/{org_id}/synthetics/agent-tokens/rotate`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/openobserve/apis/openobserve-api-http/docs/api/:org_id/synthetics/agent-tokens/rotate/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `org_id` string, required

## Request body

- object
  - `name` string, nullable: Optional operator-chosen name (e.g. per region/agent). Omitted → a timestamped name.

## Response `200`

New token (shown once)

- AgentTokenSecret: A freshly created/rotated token — the ONLY response that carries the raw value (shown once, then only ever masked).
  - `name` string, required
  - `token` string, required

## Other responses

- `400`: Token name already exists
- `403`: Admin or Root role required

---

[API](https://skmtc.dev/openobserve/apis/openobserve-api-http.md) - [All operations](https://skmtc.dev/openobserve/apis/openobserve-api-http/llms.txt) - [OpenAPI document](https://skmtc.dev/openobserve/apis/openobserve-api-http/revisions/0529b8a10252?raw)
