---
title: "ADMIN-OPS-001 — edit any agent's description / visibility (admin-gated)"
method: PATCH
path: "/api/v1/admin/agents/{agent_id}"
tags: ["admin"]
---

# ADMIN-OPS-001 — edit any agent's description / visibility (admin-gated)

`PATCH /api/v1/admin/agents/{agent_id}`

## Request

- Base URL: `https://api.badgeia.com`
- URL: `https://api.badgeia.com/api/v1/admin/agents/{agent_id}`
- Auth: none declared

Admin edit of ANY agent — regardless of owner.

v1 fields: `description` and `is_public`. Uses `exclude_unset` so an
omitted field is untouched while an explicit null clears the description.
This is how the operator fixes reference-agent copy without owning the row.

Audit `detail` records only the NAMES of the fields changed (never the new
description text) so the trail stays small + content-free.

Auth: anonymous → 401, non-admin → 403, admin → 200. Flag-off → 404.
404 when the agent doesn't exist.

## Path parameters

- `agent_id` string, uuid, required

## Request body

- AdminAgentPatch: Body for PATCH /admin/agents/{agent_id}. Both fields are optional so a partial edit only touches what it names. We use ``model_dump(exclude_unset=True)`` in the handler to distinguish "field omitted" from "field set to null" — so a caller CAN clear a description by sending ``{"description": null}`` explicitly, while a caller who only flips visibility leaves the description untouched. ``description`` is capped at 4000 chars — generous for the reference-agent copy this is built to fix, but bounded so an admin PATCH can't write an unbounded blob into the Text column.
  - `description` string, nullable
  - `is_public` boolean, nullable

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/badgeia/apis/badge.md) · [All operations](https://skmtc.dev/badgeia/apis/badge/llms.txt) · [OpenAPI document](https://skmtc.dev/badgeia/apis/badge/revisions/7e7f7fee8b77?raw)
