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

# Duplicate Agent

> Duplicate an agent template and return the duplicated graph.

Creates a new agent by copying the source template's metadata, nodes, and connections.

Response shape matches [Get Agent](/api/agents/get-agent): `agent`, `agent_nodes`, and `connections`.

## Request

```bash theme={null}
curl -X POST "https://api.mosaic.so/agent/123e4567-e89b-12d3-a456-789012345678/duplicate" \
  -H "Authorization: Bearer mk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Copy of My Agent",
    "description": "Optional override description",
    "visibility": "private"
  }'
```

All body fields are optional.

## Body Parameters

| Field         | Type   | Required | Description                                                                         |
| ------------- | ------ | -------- | ----------------------------------------------------------------------------------- |
| `name`        | string | No       | Name for the duplicated agent (`1-120` chars). Defaults to `Copy of <source name>`. |
| `description` | string | No       | Description override (`<=5000` chars). Defaults to source description.              |
| `visibility`  | string | No       | `public` or `private`. Defaults to source visibility.                               |

## Response

```json theme={null}
{
  "agent": {
    "id": "9c2d2aef-58c6-4af2-845f-d7f2d4d0a9c5",
    "name": "Copy of My Agent",
    "description": "Optional override description",
    "visibility": "private",
    "created_at": "2026-03-20T20:17:00Z",
    "updated_at": "2026-03-20T20:17:00Z"
  },
  "agent_nodes": [
    {
      "agent_node_id": "bf750792-a2e9-48c2-9d39-24f892772f6a",
      "node_type": {
        "node_type_id": "3b281fb9-9eb2-40f6-b05b-4b6f909a3da9",
        "node_type_name": "AI Music",
        "docs_url": "https://docs.mosaic.so/tiles/ai-music",
        "params_docs_url": "https://docs.mosaic.so/tiles/ai-music#api-info"
      },
      "params_used": {
        "use_intelligent_analysis": true
      }
    }
  ],
  "connections": [
    {
      "source_agent_node_id": "bf750792-a2e9-48c2-9d39-24f892772f6a",
      "target_agent_node_id": "a1c2d3e4-5678-90ab-cdef-1234567890ab"
    }
  ]
}
```
