Duplicate Agent
curl --request POST \
--url https://api.example.com/agent/{agent_id}/duplicateimport requests
url = "https://api.example.com/agent/{agent_id}/duplicate"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/agent/{agent_id}/duplicate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/agent/{agent_id}/duplicate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/agent/{agent_id}/duplicate"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/agent/{agent_id}/duplicate")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/agent/{agent_id}/duplicate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyAgents
Duplicate Agent
Duplicate an agent template and return the duplicated graph.
POST
/
agent
/
{agent_id}
/
duplicate
Duplicate Agent
curl --request POST \
--url https://api.example.com/agent/{agent_id}/duplicateimport requests
url = "https://api.example.com/agent/{agent_id}/duplicate"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/agent/{agent_id}/duplicate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/agent/{agent_id}/duplicate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/agent/{agent_id}/duplicate"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/agent/{agent_id}/duplicate")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/agent/{agent_id}/duplicate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyCreates a new agent by copying the source template’s metadata, nodes, and connections.
Response shape matches Get Agent:
All body fields are optional.
agent, agent_nodes, and connections.
Request
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"
}'
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
{
"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"
}
]
}
Was this page helpful?
⌘I