curl -X POST "http://localhost:8000/api/v2/agents" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "customer-support",
"pattern": "support",
"description": "Handles customer inquiries"
}'
{
"agent_id": "customer-support",
"namespace": "memanto_agent_customer-support",
"pattern": "support",
"description": "Handles customer inquiries",
"created_at": "2026-05-04T10:30:00.000000",
"last_session": null,
"memory_count": 0,
"session_count": 0,
"status": "ready"
}
{
"detail": "Unauthorized. Agent management endpoints require either a loopback client or a valid management credential (Authorization: Bearer <key> or X-Api-Key)."
}
{
"detail": {
"error": "AgentAlreadyExists",
"message": "Agent 'customer-support' already exists",
"details": {}
}
}
{
"detail": [
{
"type": "missing",
"loc": [
"body",
"agent_id"
],
"msg": "Field required",
"input": {}
}
]
}
{
"detail": {
"error": "InternalServerError",
"message": "An unexpected error occurred",
"details": {
"original_error": "..."
}
}
}
Agent Management
Create Agent
Create a new agent to establish a dedicated Moorcheh namespace for storing and retrieving memories.
POST
/
api
/
v2
/
agents
curl -X POST "http://localhost:8000/api/v2/agents" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "customer-support",
"pattern": "support",
"description": "Handles customer inquiries"
}'
{
"agent_id": "customer-support",
"namespace": "memanto_agent_customer-support",
"pattern": "support",
"description": "Handles customer inquiries",
"created_at": "2026-05-04T10:30:00.000000",
"last_session": null,
"memory_count": 0,
"session_count": 0,
"status": "ready"
}
{
"detail": "Unauthorized. Agent management endpoints require either a loopback client or a valid management credential (Authorization: Bearer <key> or X-Api-Key)."
}
{
"detail": {
"error": "AgentAlreadyExists",
"message": "Agent 'customer-support' already exists",
"details": {}
}
}
{
"detail": [
{
"type": "missing",
"loc": [
"body",
"agent_id"
],
"msg": "Field required",
"input": {}
}
]
}
{
"detail": {
"error": "InternalServerError",
"message": "An unexpected error occurred",
"details": {
"original_error": "..."
}
}
}
Overview
Create a new agent namespace for storing and retrieving memories. Each agent receives a uniqueagent_id which acts as an isolated context container in Moorcheh (memanto_agent_{agent_id}).
Authentication
Memanto validates Moorcheh credentials on the server usingMOORCHEH_API_KEY (environment / server configuration).
string
Bearer <key> — required unless the request originates from a loopback client. See Management Endpoint Authentication.string
Alternative to
Authorization: Bearer — same credential.string
required
Must be
application/jsonBody
string
required
Unique agent identifier (alphanumeric, hyphens, underscores only).
string
Agent pattern for memory organization. One of:
support, project, tool. Defaults to support.string
Optional human-readable description of the agent.
curl -X POST "http://localhost:8000/api/v2/agents" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "customer-support",
"pattern": "support",
"description": "Handles customer inquiries"
}'
{
"agent_id": "customer-support",
"namespace": "memanto_agent_customer-support",
"pattern": "support",
"description": "Handles customer inquiries",
"created_at": "2026-05-04T10:30:00.000000",
"last_session": null,
"memory_count": 0,
"session_count": 0,
"status": "ready"
}
{
"detail": "Unauthorized. Agent management endpoints require either a loopback client or a valid management credential (Authorization: Bearer <key> or X-Api-Key)."
}
{
"detail": {
"error": "AgentAlreadyExists",
"message": "Agent 'customer-support' already exists",
"details": {}
}
}
{
"detail": [
{
"type": "missing",
"loc": [
"body",
"agent_id"
],
"msg": "Field required",
"input": {}
}
]
}
{
"detail": {
"error": "InternalServerError",
"message": "An unexpected error occurred",
"details": {
"original_error": "..."
}
}
}
500 include the server missing MOORCHEH_API_KEY, an invalid key (Memanto may fail at startup), or failure to create the namespace in Moorcheh.
Next Steps
After creating a new agent, you can:- Activate Agent to start a session and obtain an operational token
- List Agents to verify it was created
- Get Agent to retrieve its configuration details