Share Agent
curl --request POST \
--url https://api.example.com/agent/{agent_id}/shareimport requests
url = "https://api.example.com/agent/{agent_id}/share"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/agent/{agent_id}/share', 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}/share",
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}/share"
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}/share")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/agent/{agent_id}/share")
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
Share Agent
Publish a mosaic behind a shareable link, optionally sharing a copy that includes its assets.
POST
/
agent
/
{agent_id}
/
share
Share Agent
curl --request POST \
--url https://api.example.com/agent/{agent_id}/shareimport requests
url = "https://api.example.com/agent/{agent_id}/share"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/agent/{agent_id}/share', 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}/share",
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}/share"
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}/share")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/agent/{agent_id}/share")
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_bodyMakes a mosaic viewable by anyone with the link, the same as the Share control in
the canvas. Set
All body fields are optional.
duplicate: true to share a copy instead: the copy is created with the
source mosaic’s completed renders and the media they reference, then published, so the
original stays private and you can keep editing it.
Revoke a link with Unshare Agent, and read the current
state with GET /agent/{agent_id}/share.
Request
curl -X POST "https://api.mosaic.so/agent/123e4567-e89b-12d3-a456-789012345678/share" \
-H "Authorization: Bearer mk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"duplicate": true,
"name": "Q3 recap (shared)"
}'
Body Parameters
| Field | Type | Required | Description |
|---|---|---|---|
duplicate | boolean | No | Share a copy instead of the mosaic itself. Defaults to false. |
include_assets | boolean | No | When duplicating, copy completed renders and their media. Defaults to true. |
name | string | No | Name for the copy (1-120 chars). Defaults to Copy of <source name>. |
description | string | No | Description for the copy (<=5000 chars). Defaults to the source description. |
Response
Returns201 when a copy was created, 200 when the mosaic itself was published.
{
"agent_id": "9c2d2aef-58c6-4af2-845f-d7f2d4d0a9c5",
"name": "Q3 recap (shared)",
"visibility": "public",
"share_url": "https://edit.mosaic.so/mosaics/9c2d2aef-58c6-4af2-845f-d7f2d4d0a9c5",
"source_agent_id": "123e4567-e89b-12d3-a456-789012345678",
"duplicated": true,
"stats": {
"nodes_copied": 6,
"connections_copied": 5,
"renders_copied": 4,
"render_media_refs_copied": 9
}
}
Was this page helpful?
⌘I