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

# Update agent

`PATCH /agents/{agent_id}`

Update an existing agent. Only fields included in the request body are changed; omitted fields are left untouched.

This endpoint edits document fields only. To attach or detach skills, use [`PATCH /agents/{agent_id}/skills`](/api-reference/agents/update-agent-skills); to manage MCP servers, use the [agent MCP server endpoints](/api-reference/agents/attach-agent-mcp-server).

## Path parameters

- `agent_id` string, required

## Request body

- object
  - `name` string, nullable
  - `model_name` string, nullable — ID of the LLM the agent runs on. Use `GET /models` to discover valid values.
  - `description` string, nullable
  - `system_prompt` string, nullable
  - `tools` object[], nullable — When provided, replaces the agent's tool list.
  - `resources` object[], nullable — When provided, replaces the agent's resource list.
  - `metadata` object, nullable
  - `is_active` boolean, nullable
  - `team_id` string, nullable — When provided, transfers ownership of the agent to this team.

## Response `200`

The updated agent.

- object
  - `agent` object
    - `id` string
    - `name` string
    - `description` string, nullable
    - `team_id` string
    - `is_active` boolean
    - `tools` object[] — Tools the agent can call. Secret references are stripped and MCP server URLs are redacted before being returned.
    - `metadata` object
    - `model_name` string, nullable
    - `system_prompt` string, nullable
    - `resources` object[]
    - `folder_id` string, nullable
    - `type` string, nullable — Internal agent type discriminator.
    - `created_at` string, date-time, nullable
    - `active_trigger_count` integer, nullable — Number of active triggers on this agent. Populated on list responses; may be `null` here.
    - `creator` object, nullable — User who created the agent. `null` when the creator is not known.
      - `id` string, nullable
      - `first_name` string, nullable
      - `last_name` string, nullable
      - `email` string, nullable
      - `profile_picture` string, nullable

## Other responses

- `400` — Invalid request body.
- `401` — Unauthorized — missing or invalid API key.
- `403` — Forbidden — the caller does not have permission to update this agent.
- `404` — Agent not found.
- `500` — Internal server error.

---

[API](https://skmtc.dev/gumloop/apis/public-api.md) · [All operations](https://skmtc.dev/gumloop/apis/public-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gumloop/public-api/revisions/115f2d6ce387/schema)
