---
title: "Update an AI Agent (v2)"
method: PUT
path: "/v2/agents/{idOrAddress}"
tags: ["Agents"]
---

# Update an AI Agent (v2)

`PUT /v2/agents/{idOrAddress}`

## Request

- Base URL: `https://api.chat.ethora.com`
- URL: `https://api.chat.ethora.com/v2/agents/{idOrAddress}`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Updates the fields present in the body; omitted fields keep their
value. Owner only: anyone else, platform admins included, gets 403.
Platform-owned agents (`ownerId: 'system'`, such as the Support Agent
template) are read-only to tenants, who clone them instead
(`POST /v2/agents/{idOrAddress}/clone`). Supports `User JWT` and
`B2B Server JWT`.

Takes the same body as `POST /v2/agents`, all fields optional.
`soulMd` (Memory) and `visibility` are applied as by
`POST /v2/agents/{idOrAddress}/soul` and `.../visibility`; a new
`ownerAppId` must be an App the caller manages (else 403
`OWNER_APP_FORBIDDEN`).

Running bots of this agent pick the change up straight away, and a new
`displayName` or `avatarUrl` is copied onto the bot users so chats
show it.

## Path parameters

- `idOrAddress` string, required

## Request body

- object: Same fields as `POST /v2/agents`, all optional.

## Response `200`

```
{ ok: true, agent: Agent }
```

## Other responses

- `400`: The flows script does not compile. ``` { error: 'Invalid flows script', code: 'FLOWS_INVALID', details: [{ path, message, line? }] } ```
- `401`: Unauthorized
- `403`: The caller does not own the agent. ``` { error: 'Forbidden', code: 'FORBIDDEN' } ```
- `404`: ``` { error: 'Agent not found', code: 'AGENT_NOT_FOUND' } ```
- `422`: Validation error, including an unknown field or category. ``` { error: string, code: 'VALIDATION_ERROR' } ```
- `500`: Internal Server Error

---

[API](https://skmtc.dev/ethora/apis/platform-api.md) · [All operations](https://skmtc.dev/ethora/apis/platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ethora/apis/platform-api/revisions/01b6e64378ee?raw)
