---
title: "Update an agent"
method: PATCH
path: "/api/v1/agents/{id}"
tags: ["Agents"]
---

# Update an agent

`PATCH /api/v1/agents/{id}`

## Request

- Base URL: `https://your-deployment.example.com`
- URL: `https://your-deployment.example.com/api/v1/agents/{id}`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Updates an agent you own. Omitted fields are left unchanged. Only the owner can update an agent. Unknown body fields are rejected.

## Path parameters

- `id` string, required

## Request body

- UpdateAgentRequest
  - `name` string
  - `description` string
  - `system_prompt` string
  - `preferred_model` string, nullable: A chat model id. An unknown model is rejected with a 422.
  - `temperature` number, nullable
  - `max_tokens` integer, nullable
  - `allowed_tools` string[]: Tools the agent may call. An empty list (or `null`) means the default tool policy applies.
  - `denied_tools` string[]: Tools the agent may never call. An empty list (or `null`) means the default tool policy applies.
  - `trigger_words` string[]: Mentions (for example `@research`) that invoke the agent in chat.

## Response `200`

The updated agent.

- UpdateAgentResponse200
  - `id` string, required
  - `name` string, required
  - `description` string, required
  - `system_prompt` string, nullable, required: The agent's system prompt. `null` unless the caller owns the agent.
  - `preferred_model` string, nullable, required: Model id the agent answers with; `null` uses the default.
  - `temperature` number, nullable, required
  - `max_tokens` integer, nullable, required
  - `allowed_tools` string[], nullable, required: Tools the agent may call. An empty list (or `null`) means the default tool policy applies.
  - `denied_tools` string[], nullable, required: Tools the agent may never call. An empty list (or `null`) means the default tool policy applies.
  - `trigger_words` string[], required: Mentions (for example `@research`) that invoke the agent in chat.
  - `is_owner` boolean, required: Whether the caller owns the agent, rather than having it shared with them.
  - `created_at` string, nullable, required: ISO 8601 timestamp.
  - `updated_at` string, nullable, required: ISO 8601 timestamp.

## Other responses

- `401`: Missing or invalid credentials.
- `403`: The API key lacks `agents:write`.
- `404`: No agent with that id is yours. An agent shared with you, one that does not exist, a deleted agent and a malformed id are all reported as 404, so agent ids cannot be probed through this endpoint.
- `405`: The path does not serve this HTTP method.
- `422`: Request body failed validation: an unknown field, an out-of-range value, an unknown `preferred_model`, or a malformed `trigger_words`/tool list.
- `429`: Per-user rate limit exceeded.

---

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