---
title: "Enable or disable (revoke) a named agent token"
method: PATCH
path: "/api/{org_id}/synthetics/agent-tokens/{name}"
tags: ["Synthetics"]
---

# Enable or disable (revoke) a named agent token

`PATCH /api/{org_id}/synthetics/agent-tokens/{name}`

## 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/{name}`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/openobserve/apis/openobserve-api-http/docs/api/:org_id/synthetics/agent-tokens/:name/patch.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `org_id` string, required
- `name` string, required

## Request body

- object
  - `enabled` boolean, required

## Response `200`

Success

- object

## Other responses

- `400`: Cannot disable the default token — rotate first
- `403`: Admin or Root role required
- `404`: Token not found

---

[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)
