---
title: "Create an agent"
method: POST
path: "/agent/create"
tags: ["Agents"]
---

# Create an agent

`POST /agent/create`

## Request

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

Create an agent template (metadata only). Graph mutations are handled via /agent/{agent_id}/update.

## Request body

- object
  - `name` string
  - `description` string
  - `visibility` 'public' | 'private'
  - `workspace_id` string, uuid

## Response `201`

Agent created successfully

- AgentMutationResponse
  - `success` boolean, required
  - `agent_id` string, uuid, required
  - `operations_applied` integer, required
  - `created_nodes` object[], required
    - `temp_ref_id` string, nullable
    - `agent_node_id` string, uuid

## Other responses

- `400`: Invalid request
- `401`: Authentication failed
- `403`: Access denied

---

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