---
title: "Create share link"
method: POST
path: "/agent/{agent_id}/share"
tags: ["Agents"]
---

# Create share link

`POST /agent/{agent_id}/share`

## Request

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

Publish a mosaic behind a link anyone can open. With duplicate set to true the mosaic is copied first, including its renders and media, and the copy is published so the original stays private.

## Path parameters

- `agent_id` string, required

## Request body

- AgentShareRequest
  - `duplicate` boolean: Share a copy of the mosaic instead of the mosaic itself, leaving the original private.
  - `include_assets` boolean: When duplicating, copy completed renders and the media they reference.
  - `run_id` string, uuid: Finished run (completed or partial_complete) whose renders should be copied. Requires duplicate=true and include_assets=true.
  - `name` string
  - `description` string

## Response `200`

Mosaic shared

- AgentShareResponse
  - `agent_id` string: The shared mosaic. When duplicate is true this is the new copy.
  - `name` string
  - `visibility` 'public' | 'private'
  - `share_url` string, nullable: Link anyone can open, or null when the mosaic is private.
  - `source_agent_id` string: Mosaic the copy was made from. Only present when duplicate is true.
  - `source_run_id` string, uuid, nullable: Completed run used as the render source, or null when template-node renders were copied.
  - `duplicated` boolean
  - `stats` AgentDuplicateStats
    - `nodes_copied` integer
    - `connections_copied` integer
    - `renders_copied` integer
    - `render_media_refs_copied` integer

## Other responses

- `201`: Copy created and shared
- `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)
