---
title: "Duplicate agent"
method: POST
path: "/agent/{agent_id}/duplicate"
tags: ["Agents"]
---

# Duplicate agent

`POST /agent/{agent_id}/duplicate`

## Request

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

Duplicate an existing agent template and return the duplicated graph payload.

## Path parameters

- `agent_id` string, required

## Request body

- AgentDuplicateRequest
  - `name` string
  - `description` string
  - `visibility` 'public' | 'private'
  - `include_renders` boolean: Copy completed renders and the media they reference onto the duplicate.

## Response `201`

Agent duplicated successfully

- AgentMetadataResponse
  - `agent` object
    - `id` string
    - `name` string
    - `description` string
    - `visibility` string, nullable
    - `created_at` string, date-time
    - `updated_at` string, date-time
  - `agent_nodes` AgentNodeSummary[]
    - `agent_node_id` string
    - `node_type` NodeTypeSummary
      - `node_type_id` string, uuid
      - `node_type_name` string, nullable
      - `docs_url` string, nullable: Canonical docs page URL derived from nodes.docs_path.
      - `params_docs_url` string, nullable: Exact docs section URL derived from nodes.docs_anchor (for node params/API details).
    - `params_used` object
  - `connections` AgentConnection[]
    - `source_agent_node_id` string
    - `target_agent_node_id` string

## 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)
