# Edit a saved agent.

`PATCH /o/{org}/agents/{agent}`

Send only what changes, in the body a create takes; the rest is kept, and the result is checked against today's catalog. A person's edit reads the short body as a key's does, and an unknown field is `400 UNKNOWN_FIELD` beside the short body or the console editor's config. `harness` cannot change. Only the creator can edit. Send `visibility` alone to change who can use the agent. Once the creator has left the org, an org admin may send `{"visibility": "private"}` alone, and nothing else, even for an agent they cannot see; the answer is then only `{id, visibility}` and `If-Match` is optional. Sessions already started keep what they started with. Editing a template changes the next session of every agent made from it. An agent made from a template takes `name` and `description` only, or `archive: true` alone, which removes it as `DELETE` does; a field the template owns is `422 TEMPLATE_FIELDS`, anything else `422 INVALID_BODY`.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `org` | path | string | yes | The org's slug or id. A caller with no role in the org gets `404`. |
| `agent` | path | string | yes | The saved agent's id, or its exact name (a plain agent or one made from a template). Two agents of that name are `422 INVALID_BODY`; send the id. `available` and `community` are paths beside this one, so no agent may be named either. An archived agent, and an orphaned agent an org admin cannot see, are reached by id only. |
| `if-match` | header | string | no | The `ETag` of the revision you read; another revision is `412 STALE_ETAG`. A signed-in caller must send it (`428 IF_MATCH_REQUIRED`); an API key may leave it out. |

## Request body

- `visibility` (string, optional, one of `private`, `org`, `public`): Creator only (or `private` from an org admin, for an agent whose creator left the org); send alone as a separate sharing change. public submits the agent to Community for review: an org admin, with `category`, `subtitle` and `triggers`. Once Phoenix approves it, the listing is public: anyone reads it at `GET /community/agents` and on getrush.ai/templates/. private or org withdraws a listing.
- `category` (string, optional, one of `Engineering`, `Business`, `Marketing`, `General`): With visibility public.
- `subtitle` (string, optional): With visibility public; one line.
- `triggers` (array of string, optional): With visibility public: how the agent starts, by kind. `request` is a run someone starts with the API, an MCP client or the console; the rest are automation trigger kinds. Phoenix reviews them with the revision, and the listing shows them on getrush.ai. Leave it out to keep the last submission's, else the listed ones.
- `logo` (string | null, optional): With visibility public: the listing's square logo as a base64 `data:` URI of a PNG, JPEG or WebP image, at most 2 MiB. Leave it out to keep the last submission's, else the listed one; `null` lists none.
- `cover` (string | null, optional): With visibility public: the listing's wide cover image (shown about 4:1), in the same form as `logo`.
- `name` (string, optional)
- `description` (string, optional)
- `model` (string, optional)
- `effort` (string, optional)
- `instructions` (string, optional)
- `skills` (array of string | object | object, optional)
  - `url` (string, required)
- `connections` (array of string | object, optional)
  - `name` (string, required): The connection's id or name.
  - `access` (string, required, one of `read`, `send`): `read`: read mail (and Outlook contacts). `send`: read and send. Absent: all of the app's access, which for Gmail also changes labels and for Outlook is the same as `send`.
- `capabilities` (object, optional)
  - `browser` (boolean, optional)
  - `computer` (boolean, optional)
- `runtime` (SavedAgentRuntime, optional): `{selection: "latest_verified"}` (the default) keeps the harness CLI current; `{selection: "pinned", id}` holds one release. A pin set on a create or an edit must be the harness's `cli_version` in `GET /o/{org}/agents/available`, the release its models are checked on; any other is `422 UNSUPPORTED_PROFILE` with field code `RUNTIME_NOT_VERIFIED`. A pin already saved stays through later edits, and an agent customized from another keeps that agent's pin.
  - `selection` (string, required, one of `latest_verified`, `pinned`)
  - `id` (string, optional)
- `tools` (SavedAgentTools, optional): `{mode: "default"}` (the default) runs every native tool; `{mode: "selected", ids}` only the ids named, from the harness's `tools` in `GET /o/{org}/agents/available` (Claude Code only). With skills or a plugin that has skills, `ids` must include `Skill`.
  - `mode` (string, required, one of `default`, `selected`)
  - `ids` (array of string, optional)
- `network` (SavedAgentNetwork, optional): `{mode: "public"}` (the default). `{mode: "allowlist", domains}` is `422 UNSUPPORTED_PROFILE` (`NETWORK_ENFORCEMENT_NOT_QUALIFIED`) until a runtime enforces it.
  - `mode` (string, required, one of `public`, `allowlist`)
  - `domains` (array of string, optional)
- `plugins` (array of object, optional): Catalog plugins installed into every run of the agent, by the harness's `plugins` in `GET /o/{org}/agents/available`; each is pinned by its digest when saved. One the harness does not list is `422 UNSUPPORTED_PROFILE`.
  - `catalog_id` (string, required)

## Example request

```bash
curl -X PATCH "https://api.phoenix.so/o/$RUSH_ORG/agents/$AGENT" \
  -H "Authorization: Bearer $RUSH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
```

```typescript
const org = process.env.RUSH_ORG;
const agent = process.env.AGENT;

const res = await fetch(`https://api.phoenix.so/o/${org}/agents/${agent}`, {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.RUSH_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});

console.log(res.status, await res.json());
```

```python
import os

import requests

org = os.environ["RUSH_ORG"]
agent = os.environ["AGENT"]

res = requests.patch(
    f"https://api.phoenix.so/o/{org}/agents/{agent}",
    headers={"Authorization": f"Bearer {os.environ['RUSH_TOKEN']}"},
    json={},
)

print(res.status_code, res.json())
```

## Responses

### 200

The agent as edited; for an org admin's unshare of an orphaned agent, only its id and visibility.


### 400

An unknown or removed field, as on create.

### 401

No bearer, an unknown, revoked or expired one, or an API key on a route keys cannot call.

### 403

A visible agent belongs to another creator (`FORBIDDEN`).

### 404

No such agent visible to you (`NOT_FOUND`).

### 412

A concurrent edit won (`STALE_ETAG`); read the agent and send the edit again.

### 422

`IMMUTABLE_FIELD` (`harness` or `handle` sent), `TEMPLATE_FIELDS` (a field an agent's template sets), or any create-time code, checked against the merged setup: `UNSUPPORTED_PROFILE` with `fields` names each choice the catalog does not support, such as `tools.ids` `SKILL_TOOL_REQUIRED` when skills (pinned or from a plugin) meet a tool selection without `Skill`.

### 428

A signed-in caller sent no `If-Match` (`IF_MATCH_REQUIRED`).

### 429

The account is over its request budget, 1,800 a minute shared by the person's API keys and console on every API host (`RATE_LIMITED`). The error names the limit. Wait `Retry-After` seconds.

## Example response (200)

```json
{
  "id": "6244972a-14cc-4592-a0e3-c7a0ab45b07b",
  "user_id": "3b8e1d4a-7c2f-4a90-b6e5-0d9f2c1a8e37",
  "org_id": "9a4c2e71-5b3d-4f86-a1c0-7e2d8b6f3a95",
  "name": "Plugin reviewer",
  "handle": "plugin-reviewer-5f2a9c1e",
  "visibility": "private",
  "harness": "claude",
  "revision": 2,
  "catalog_revision": "a1440865d9c3d950cc93bfa8768e1b485d0853343e60fec08352ada1cf2ee718",
  "runtime": {
    "selection": "latest_verified"
  },
  "model": "claude-opus-5-5",
  "effort": "max",
  "speed": "standard",
  "instructions": "Review each plugin.json and report every problem with its file and a fix.",
  "skills": [
    {
      "url": "https://github.com/anthropics/skills/tree/main/skills/frontend-design",
      "name": "frontend-design"
    }
  ],
  "connections": [
    {
      "id": "1f6a8d3e-9c2b-4e70-b5d1-7a4e0c3f8b96",
      "kind": "mcp",
      "name": "deepwiki"
    }
  ],
  "created_at": "2026-10-07T10:48:16.000Z",
  "updated_at": "2026-10-09T08:03:27.000Z",
  "description": "Checks plugin manifests before a release."
}
```
