---
title: "Update an agent (PATCH alias)"
method: PATCH
path: "/agent/{agent_id}/update"
tags: ["Agents"]
---

# Update an agent (PATCH alias)

`PATCH /agent/{agent_id}/update`

## Request

- Base URL: `https://api.mosaic.so`
- URL: `https://api.mosaic.so/agent/{agent_id}/update`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

Alias for POST /agent/{agent_id}/update.

## Path parameters

- `agent_id` string, uuid, required

## Request body

- object
  - `name` string
  - `description` string
  - `visibility` 'public' | 'private'
  - `operations` union[]
    - union
      - object
        - `op` 'create_node', required
        - `temp_ref_id` string: Temporary request-scoped node reference for linking operations in the same payload. Not persisted.
        - `node_type_id` string, uuid, required
        - `params_used` object
      - object
        - `op` 'update_node', required
        - `agent_node_id` string, uuid, required
        - `params_used` object, required
      - object
        - `op` 'delete_node', required
        - `agent_node_id` string, uuid, required
      - object: Provide exactly one source reference and exactly one target reference.
        - `op` 'create_connection', required
        - `source_agent_node_id` string, uuid: Source existing node identifier.
        - `source_temp_ref_id` string: Source temp reference from an earlier create_node operation in the same request; must already exist.
        - `target_agent_node_id` string, uuid: Target existing node identifier.
        - `target_temp_ref_id` string: Target temp reference from an earlier create_node operation in the same request; must already exist.
      - object: Provide exactly one source reference and exactly one target reference.
        - `op` 'delete_connection', required
        - `source_agent_node_id` string, uuid: Source existing node identifier.
        - `source_temp_ref_id` string: Source temp reference from an earlier create_node operation in the same request; must already exist.
        - `target_agent_node_id` string, uuid: Target existing node identifier.
        - `target_temp_ref_id` string: Target temp reference from an earlier create_node operation in the same request; must already exist.

## Response `200`

Agent updated successfully

- AgentMutationResponse
  - `success` boolean, required
  - `agent_id` string, uuid, required
  - `operations_applied` integer, required
  - `created_nodes` object[], required
    - `temp_ref_id` string, nullable
    - `agent_node_id` string, uuid

## Other responses

- `400`: Invalid request
- `401`: Authentication failed
- `403`: Access denied
- `404`: Resource not found

---

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