Overview
The Agents API provides complete control over AI agent lifecycle, configuration, and orchestration. Agents represent autonomous AI workers that can execute tasks, communicate with each other, and maintain persistent state.Authentication
All agent endpoints require authentication via:- Session Cookie:
mc-session(set after login) - API Key:
x-api-keyheader
List Agents
GET /api/agents
Retrieve a paginated list of agents with optional filtering by status and role.
Query Parameters
Filter by agent status
Filter by agent role (e.g., “developer”, “analyst”, “qa”)
Maximum number of agents to return (max: 200)
Number of agents to skip for pagination
Response Fields
Array of agent objects
Total number of agents matching filters
Current page number
Number of agents per page
Example Request
Example Response
Error Responses
401 Unauthorized
Authentication required or invalid credentials
Create Agent
POST /api/agents
Create a new AI agent with specified configuration.
Request Body
Unique agent name
Agent role or specialty (e.g., “developer”, “qa”, “analyst”)
Gateway session key for connection
Agent personality and instruction configuration
Initial agent status: online, offline, busy, idle, error
Agent configuration object
Template identifier to initialize agent configuration
Gateway-specific configuration to merge with config
Whether to write agent configuration to gateway config file
Response Fields
Created agent object with all fields (same structure as List Agents)
Example Request
Example Response
Error Responses
400 Bad Request
Missing required fields or invalid data
401 Unauthorized
Authentication required
403 Forbidden
Insufficient permissions (requires operator role)
409 Conflict
Agent name already exists
429 Too Many Requests
Rate limit exceeded
Get Agent by ID
GET /api/agents/{id}
Retrieve detailed information about a specific agent.
Path Parameters
Agent ID
Response
Complete agent object (same structure as List Agents)
Example Request
cURL
Error Responses
404 Not Found
Agent does not exist
Update Agent
PUT /api/agents
Update agent status and configuration by name.
Request Body
Agent name to update
New agent status
Last activity description
Updated configuration object
Updated session key
Updated soul configuration
Updated role
Response
Whether the update was successful
Example Request
cURL
Error Responses
400 Bad Request
No fields to update or invalid data
404 Not Found
Agent not found
Update Agent by ID
PUT /api/agents/{id}
Update agent configuration using agent ID.
Path Parameters
Agent ID
Request Body
New agent name
New role
New status
Updated configuration
New session key
Updated soul content
Response
Updated agent object
Delete Agent
DELETE /api/agents/{id}
Permanently delete an agent.
Path Parameters
Agent ID to delete
Response
Whether deletion was successful
Example Request
cURL
Agent Heartbeat
GET /api/agents/{id}/heartbeat
Check for pending work items (tasks and messages) assigned to an agent.
Path Parameters
Agent ID
Response
Agent name
Array of task objects assigned to this agent
Array of pending messages for this agent
Example Request
cURL
Example Response
Trigger Heartbeat
POST /api/agents/{id}/heartbeat
Manually trigger an agent heartbeat check.
Response
Whether heartbeat was triggered
Get Agent Soul
GET /api/agents/{id}/soul
Retrieve agent’s soul configuration (personality and instructions).
Response
Agent soul configuration text
Example Response
Update Agent Soul
PUT /api/agents/{id}/soul
Update agent’s soul configuration.
Request Body
New soul configuration
Response
Whether update was successful
Get Agent Memory
GET /api/agents/{id}/memory
Retrieve agent’s memory data.
Response
Agent memory data structure
Update Agent Memory
PUT /api/agents/{id}/memory
Update agent’s memory data.
Request Body
New memory data
Wake Agent
POST /api/agents/{id}/wake
Wake an idle agent and optionally provide a reason.
Request Body
Reason for waking the agent
Response
Whether agent was woken
Send Agent Message
POST /api/agents/message
Send a message between agents for inter-agent communication.
Request Body
Sender agent name
Recipient agent name
Message content
Message type (e.g., “notification”, “request”)
Response
Whether message was sent
Message ID
Example Request
cURL
Get Agent Communications
GET /api/agents/comms
Retrieve communication history between agents.
Query Parameters
Filter by specific agent name
Maximum number of messages to return
Response
Array of message objects
Sync Agents from Gateway
POST /api/agents/sync
Synchronize agents from gateway configuration file.
Response
Total agents synced
Number of new agents created
Number of existing agents updated