> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chatnorris.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update agent

> Modify the settings of an existing AI agent.

# Update agent

Updates one or more fields of an agent. Only the fields included in the body are modified — the rest stay unchanged.

```http theme={null}
PATCH https://app.chatnorris.ai/api/v2/chatbots/{chatbot_id}
Authorization: Bearer <your_api_key>
Content-Type: application/json
```

**Required scope:** `chatbots:write`

***

## Path parameters

| Parameter | Type | Description |
| - | - | - |
| `chatbot_id` | string | ID of the agent to update |

***

## Request body

All fields are optional. Only the included fields are updated.

| Field | Type | Description |
| - | - | - |
| `name` | string | Agent name (1–100 characters) |
| `description` | string \| null | Agent description (max. 500 characters) |
| `system_prompt` | string | System instructions |
| `model` | string | AI model (e.g. `claude-sonnet-4-6`, `gpt-4o`) |
| `temperature` | number | Temperature between `0` and `1` |
| `max_tokens` | integer | Maximum reply tokens (100–4096) |
| `is_active` | boolean | Whether the agent is active |
| `widget_config` | object | Widget visual settings (replaced in full) |

### Example

```json theme={null}
{
  "system_prompt": "You are Acme Corp's assistant. Always reply in Spanish.",
  "temperature": 0.4,
  "model": "claude-haiku-4-5-20251001"
}
```

***

## Response

Returns the agent with all fields updated.

```json theme={null}
{
  "status": "success",
  "data": {
    "id": "bot_abc123",
    "name": "Customer support",
    "description": null,
    "system_prompt": "You are Acme Corp's assistant. Always reply in Spanish.",
    "model": "claude-haiku-4-5-20251001",
    "temperature": 0.4,
    "max_tokens": 1000,
    "is_active": true,
    "is_published": true,
    "widget_config": { ... },
    "created_at": "2025-03-20T14:30:00.000Z",
    "updated_at": "2026-06-30T18:30:00.000Z"
  }
}
```

***

## Common errors

| Code | Description |
| - | - |
| `INVALID_INPUT` | A field fails validation (e.g. `temperature` out of range) |
| `NOT_FOUND` | The agent doesn't exist or doesn't belong to your organization |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.