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

# Update an agent

`PATCH /agents/{id}`

## Request

- Base URL: `https://app.artil.ai/api`
- URL: `https://app.artil.ai/api/agents/{id}`
- Auth: one of:
  - HTTP bearer
  - OAuth 2
    - Authorization code: `https://mcp.artil.ai/oauth/authorize`
    - Token URL: `https://mcp.artil.ai/oauth/token` scopes: `agent`

Rename an agent, change its icon or turn on its secrets.

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `name` string
  - `icon` 'bot' | 'sparkles' | 'bug' | 'message-square' | 'headphones' | 'search' | 'file-text' | 'mail' | 'calendar' | 'chart-line' | 'code' | 'git-pull-request' | 'database' | 'shield' | 'megaphone' | 'rocket' | 'wrench' | 'zap'
  - `secretsEnabled` true: Turn on the agent's secrets; once on, they stay on

## Response `200`

The changed agent

- Agent
  - `id` string, uuid, required
  - `name` string, required
  - `icon` 'bot' | 'sparkles' | 'bug' | 'message-square' | 'headphones' | 'search' | 'file-text' | 'mail' | 'calendar' | 'chart-line' | 'code' | 'git-pull-request' | 'database' | 'shield' | 'megaphone' | 'rocket' | 'wrench' | 'zap', required
  - `secretsEnabled` boolean, required: Whether the agent can save and use secrets; a person turns them on
  - `createdAt` string, date-time, required

## Other responses

- `4XX`: The request failed; the error says why
- `5XX`: The request failed; the error says why

---

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