Atlas API
Program the business-capable messaging layer.
Atlas API lets you connect WhatsApp, ingest business knowledge, launch Atlas-hosted or external AI agents, test the runtime, and send replies or proactive messages back through Mirai-managed channels with scoped credentials, idempotency, and webhook delivery. Treat preview-only paths as staged until your target environment has deployment evidence.
Authentication
All requests require a Bearer token in the Authorization header:
Authorization: Bearer <your_api_key>Tokens are scoped. The granted scopes on your key determine which endpoints you can call. Obtain keys from the Developer Console under your app or service account. Do not includeorganization_id in body or query parameters.
Base URLs
Atlas API
https://api.mirai.com/v1/atlasFor developer integrations, OAuth apps, service accounts.
Agent API
https://api.mirai.com/agent/v1For AI agents running on Mirai — simplified auth, tool execution endpoints.
Response format
All endpoints return a consistent envelope:
Success
{ "ok": true, "data": { ... } }Error
{ "ok": false, "error": { "code": "...", "message": "...", "retryable": false } }Scopes
atlas.messages.sendPOST /v1/atlas/messages — proactive outbound sends
atlas.channels.readGET /v1/atlas/channels
atlas.knowledge.readGET /v1/atlas/knowledge, GET /agent/v1/knowledge/search
atlas.knowledge.writePOST /v1/atlas/knowledge
atlas.agents.readGET /v1/atlas/agents
atlas.agents.writePOST /v1/atlas/agents
atlas.sessions.readGET /v1/atlas/sessions, GET /v1/atlas/sessions/:id/messages
atlas.sessions.writePOST /v1/atlas/sessions, POST /v1/atlas/sessions/:id/messages
atlas.conversations.readGET /v1/atlas/conversations, GET /v1/atlas/context/:id
atlas.actions.executePOST /v1/atlas/actions, all Agent API tool endpoints
atlas.events.readGET /v1/atlas/webhooks
atlas.events.writePOST /v1/atlas/events
atlas.runs.readGET /v1/atlas/runs
atlas.keys.writeDELETE /v1/atlas/keys/:id
Atlas API endpoints
/v1/atlas/messagesatlas.messages.sendSend a WhatsApp message to any phone number. Creates or reuses a customer and conversation automatically.
Request
{
"idempotency_key": "unique-request-id",
"phone_number": "+14155552671",
"text": "Reminder: your appointment is tomorrow.",
"template_id": "hello_world",
"category": "utility"
}Response
{ "ok": true, "data": {
"accepted": true,
"delivery_state": "queued",
"conversation_id": "uuid"
}}/v1/atlas/conversationsatlas.conversations.readReturns all WhatsApp conversations for the organization.
Response
{ "ok": true, "data": { "conversations": [...] } }/v1/atlas/context/:conversationIdatlas.context.readReturns customer info, recent messages, and knowledge grounding for a conversation.
Response
{ "ok": true, "data": {
"conversation": {...},
"customer": {...},
"recent_messages": [...],
"knowledge": [...]
}}/v1/atlas/eventsatlas.events.writeFeed an external event (e.g. webhook from another system) into the Atlas pipeline.
Request
{
"idempotency_key": "evt-001",
"channel": "whatsapp",
"customer": { "phone_number": "+14155552671" },
"event_type": "message.received",
"message": { "text": "Hi" }
}Response
{ "ok": true, "data": {
"accepted": true,
"conversation_id": "uuid",
"customer_id": "uuid"
}}/v1/atlas/actionsatlas.actions.executeReply, draft, or handoff on a conversation. Replies are sent via WhatsApp.
Request
{
"idempotency_key": "reply-001",
"conversation_id": "uuid",
"action_type": "reply",
"payload": { "text": "Thanks for reaching out!" }
}Response
{ "ok": true, "data": {
"accepted": true,
"delivery_state": "queued",
"run": {...}
}}/v1/atlas/runsatlas.runs.readReturns the audit log of all Atlas API operations for the organization.
Response
{ "ok": true, "data": { "runs": [...] } }Agent API endpoints
The Agent API is the simplest path for AI agents running on Mirai. All endpoints require a Bearer token with atlas.actions.execute scope.
/agent/v1/tools/manifestatlas.actions.executeReturns all tool definitions available to the agent, filtered by the token's granted scopes.
Response
{ "ok": true, "data": { "tools": [{ "type": "function", "function": { "name": "send_message", ... } }] } }/agent/v1/tools/send_messageatlas.actions.executeSend a WhatsApp text message within an active conversation. Requires conversation_id.
Request
{
"conversation_id": "uuid",
"text": "Thanks for your message!",
"template_id": "hello_world",
"category": "utility"
}Response
{ "ok": true, "data": {
"conversation_id": "uuid",
"queued": true,
"window_open": true,
"outbox_id": "uuid"
}}/agent/v1/tools/send_message_to_phoneatlas.actions.executeSend to any phone number. Automatically creates or reuses a customer and WhatsApp conversation.
Request
{
"phone_number": "+14155552671",
"text": "Hi! Just checking in on your appointment.",
"template_id": "hello_world",
"category": "utility"
}Response
{ "ok": true, "data": {
"conversation_id": "uuid",
"queued": true,
"window_open": true,
"outbox_id": "uuid",
"phone_number": "+14155552671"
}}/agent/v1/tools/messages/:providerMessageId/statusatlas.actions.executeCheck the delivery state of a sent message. status: sent | delivered | read | failed.
Response
{ "ok": true, "data": { "status": "delivered", "updated_at": "2026-04-07T00:00:00Z" } }/agent/v1/knowledge/searchatlas.knowledge.readQuery the shared knowledge base for grounded answers.
Response
{ "ok": true, "data": { "results": [{ "title": "...", "content": "...", "score": 0.95 }] } }Webhooks
Subscribe to events via POST /v1/atlas/webhooks. Available events:
atlas.event.receivedInbound event received via POST /v1/atlas/events
atlas.action.executedAction executed via POST /v1/atlas/actions
atlas.run.updatedRun status changed
agent.message_deliveryWhatsApp delivery status changed (sent → delivered → read)
Idempotency
All mutating endpoints accept an idempotency_key. Retrying with the same key within 24 hours replays the original response without re-executing the operation.
Idempotency keys are scoped per (organization, scope, tool_name, key).Rate limits
POST /v1/atlas/messages60 req/min per orgPOST /agent/v1/tools/*120 req/min per orgPOST /v1/atlas/actions30 req/min per orgRead endpoints300 req/min per orgProactive / outbound messaging
The 24-hour conversation window is WhatsApp's session limit. While open, free-form text works. After 24 hours of silence, you must use a pre-approved WhatsApp template. Always include template_id when sending outside an active window.
Window open
Send text freely. No template needed.
Window closed
Include template_id. Set category to utility / marketing / transactional.