---
title: "Create a named, non-default agent token (shown once)"
method: POST
path: "/api/{org_id}/synthetics/agent-tokens"
tags: ["Synthetics"]
---

# Create a named, non-default agent token (shown once)

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

## 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`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/openobserve/apis/openobserve-api-http/docs/api/:org_id/synthetics/agent-tokens/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, required: Operator-chosen name (e.g. per region/site). Required; must be unique in the org and not "default".

## 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`: Name missing/reserved/duplicate
- `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)
