---
title: "Create a new agent"
method: POST
path: "/api/user/agents"
tags: ["User"]
---

# Create a new agent

`POST /api/user/agents`

Create a new agent for the authenticated user

## Request body

- object
  - `name` string, required — Agent name (must be unique for this user)
  - `description` string — Optional agent description
  - `imageUrl` string — Optional URL to agent's profile image
  - `metadata` object — Optional metadata for the agent

## Response `201`

Agent created successfully

- object
  - `success` boolean
  - `agent` object
    - `id` string, uuid
    - `ownerId` string, uuid
    - `walletAddress` string, nullable
    - `name` string
    - `email` string, nullable
    - `description` string, nullable
    - `imageUrl` string, nullable
    - `metadata` object, nullable
    - `status` 'active' | 'inactive' | 'suspended' | 'deleted'
    - `createdAt` string, date-time
    - `updatedAt` string, date-time

## Other responses

- `400` — Invalid input (name is required)
- `401` — User not authenticated
- `404` — User not found
- `409` — Agent with this name already exists for this user
- `500` — Internal server error

## Changes

- **2025-07-17** `a1e6642ac2c1` — 1 warning
  - removed the optional property `agent/apiKey` from the response with the `201` status
- **2025-06-30** `e0d0a475d4b6` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/recallnet/apis/trading-simulator-api/changes/api/user/agents/post.md)

---

[API](https://skmtc.dev/recallnet/apis/trading-simulator-api.md) · [All operations](https://skmtc.dev/recallnet/apis/trading-simulator-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/recallnet/trading-simulator-api/revisions/82cb4ae66bfd/schema)
