---
title: "Create Agent"
method: POST
path: "/api/v2/agents"
tags: ["Sessions & Agents"]
---

# Create Agent

`POST /api/v2/agents`

## Request

- The document declares no server URL.
- Auth: none declared

Create a new MEMANTO agent

Creates:
- Agent metadata in ~/.memanto/agents/
- Moorcheh namespace: memanto_agent_{agent_id}

The agent is ready to activate once created.

## Headers

- `authorization` string, nullable
- `X-Api-Key` string, nullable

## Request body

- AgentCreate: Request to create a new agent
  - `agent_id` string, required: Unique agent identifier (alphanumeric, hyphens, underscores)
  - `pattern` 'support' | 'project' | 'tool': Agent pattern for memory organization
  - `description` string, nullable: Human-readable description of the agent

## Response `201`

Successful Response

- AgentInfo: Agent information
  - `agent_id` string, required
  - `namespace` string, required
  - `pattern` 'support' | 'project' | 'tool', required: Agent pattern types for memory organization
  - `description` string, nullable
  - `created_at` string, date-time, required
  - `last_session` string, date-time, nullable
  - `memory_count` integer
  - `session_count` integer
  - `status` string

## Other responses

- `422`: Validation Error

## Changes

- **2026-07-14** `51ea5daee7e4`: 2 info
  - added the new optional `header` request parameter `X-Api-Key`
  - added the new optional `header` request parameter `authorization`
- **2026-06-23** `3f3d8570f1a6`: 2 warning
  - deleted the `header` request parameter `X-Api-Key`
  - deleted the `header` request parameter `authorization`

[Operation history](https://skmtc.dev/moorcheh-ai/apis/memanto-memory-that-ai-agents-love/changes/api/v2/agents/post.md)

---

[API](https://skmtc.dev/moorcheh-ai/apis/memanto-memory-that-ai-agents-love.md) - [All operations](https://skmtc.dev/moorcheh-ai/apis/memanto-memory-that-ai-agents-love/llms.txt) - [OpenAPI document](https://skmtc.dev/moorcheh-ai/apis/memanto-memory-that-ai-agents-love/revisions/ef842776283e?raw)
