---
title: "Update Agent"
method: PUT
path: "/api/agents/{agent_id}"
tags: ["agents"]
---

# Update Agent

`PUT /api/agents/{agent_id}`

Update an existing agent.

## Path parameters

- `agent_id` integer, required

## Request body

- AgentUpdateRequest — Request model for updating an agent.
  - `name` string, nullable
  - `description` string, nullable
  - `instructions` string, nullable
  - `execution_mode` string, nullable — Execution mode: flash, balanced, think, or auto
  - `models` object, nullable
  - `knowledge_bases` string[], nullable
  - `skills` string[], nullable
  - `tool_categories` string[], nullable
  - `suggested_prompts` string[], nullable — Suggested prompt examples for users
  - `logo_base64` string, nullable
  - `widget_enabled` boolean, nullable
  - `allowed_domains` string[], nullable

## Response `200`

Successful Response

- AgentResponse — Response model for agent data.
  - `id` integer, required
  - `user_id` integer, required
  - `name` string, required
  - `description` string, nullable, required
  - `instructions` string, nullable, required
  - `execution_mode` string, required
  - `models` object, nullable, required
  - `knowledge_bases` string[], required
  - `skills` string[], required
  - `tool_categories` string[], required
  - `suggested_prompts` string[], required
  - `logo_url` string, nullable, required
  - `status` string, required
  - `published_at` string, nullable, required
  - `created_at` string, required
  - `updated_at` string, required
  - `widget_enabled` boolean, required
  - `allowed_domains` string[], required
  - `share_enabled` boolean, required
  - `share_updated_at` string, nullable, required

## Other responses

- `422` — Validation Error

## Changes

- **2026-06-13** `33e4ba4936ad` — 2 info
  - added the required property `share_enabled` to the response with the `200` status
  - added the required property `share_updated_at` to the response with the `200` status
- **2026-05-01** `c9eb29ec9a1b` — 4 info
  - added the new optional request property `allowed_domains`
  - added the new optional request property `widget_enabled`
  - added the required property `allowed_domains` to the response with the `200` status
  - added the required property `widget_enabled` to the response with the `200` status

[Change history](https://skmtc.dev/xorbitsai/apis/xagent/changes/api/agents/:agent_id/put.md)

---

[API](https://skmtc.dev/xorbitsai/apis/xagent.md) · [All operations](https://skmtc.dev/xorbitsai/apis/xagent/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/xorbitsai/xagent/revisions/33e4ba4936ad/schema)
