Atlas API Reference

Program the business-capable messaging layer.

Atlas API connects WhatsApp, launches AI agents, executes transactional business operations, and delivers proactive messages — with idempotency, server-derived tenant identity, and full audit trails built in.

What Atlas API enables

Four capability pillars, one unified API.

Channel transport

Connect WhatsApp Business API, ingest inbound messages, and deliver outbound responses — structured and trackable.

AI orchestration

Launch Atlas-hosted agents or plug in external AI runtimes. Atlas handles intent classification, knowledge retrieval, and routing.

Transactional operations

Execute loyalty adjustments, voucher operations, and booking mutations — idempotent, atomic, and ledger-backed.

Proactive messaging

Send outbound WhatsApp messages to any phone number. Template-aware, window-aware, and delivery-tracked.

Quickstart

From sandbox credentials to first tool call in 4 steps.

01

Get sandbox credentials

Start with sandbox credentials before production go-live. Keys are scoped and tenant identity is derived by Mirai, not supplied in the request body.

curl https://api.usemirai.app/sandbox/credentials
02

Connect WhatsApp

Use Developer Console go-live only after channel readiness and human owner approval. Sandbox examples use the bundled phone fleet.

GET /v1/atlas/channels
// Returns connected production channels for the authenticated organization.
03

Ingest knowledge

Upload your business knowledge — service menus, policies, pricing — so Atlas can ground responses in real data.

POST /v1/atlas/knowledge
{
  "source_type": "text",
  "title": "Menu and recovery policy",
  "content": "Lunch sets start at S$14. Abandoned orders may receive a reminder, not an invented discount."
}
04

Send your first message

Send a proactive WhatsApp message to any phone number. Atlas creates the customer and conversation automatically.

POST /atlas/v1/tools/send_message_to_phone
{
  "idempotency_key": "sandbox-message-1",
  "phone_number": "+10000000001",
  "text": "Reminder: your pickup is ready.",
  "category": "utility"
}
Atlas API — REST

Core endpoints

POST

Send WhatsApp message

Send a text or template message to any phone number. Automatically creates or reuses a customer and conversation.

atlas.messages.send
GET

List conversations

Retrieve all WhatsApp conversations for your organization, filtered by status and date range.

atlas.conversations.read
GET

Get conversation context

Fetch full conversation context — customer profile, message history, and knowledge grounding for a specific conversation.

atlas.conversations.read
POST

Ingest inbound event

Feed an external event (webhook from another system) into the Atlas pipeline.

atlas.events.write
POST

Execute action

Reply, draft, or hand off on a conversation. Replies are sent via WhatsApp.

atlas.actions.execute
GET

Audit log

Retrieve the full audit log of all Atlas API operations — messages sent, actions executed, errors.

atlas.runs.read
Agent API — AI agent tools

Canonical agent tool endpoints

GET

Get tool manifest

Returns all available tools for your agent, filtered by the scopes granted to your API key.

atlas.actions.execute
POST

Reply in conversation

Send a WhatsApp message within an active conversation. Requires a conversation_id.

atlas.actions.execute
POST

Proactive send

Send to any phone number. Automatically creates or reuses a customer and conversation.

atlas.actions.execute
GET

Search knowledge

Query the shared knowledge base for grounded answers using semantic search.

atlas.knowledge.read

Built for correctness, not just speed

Scoped API keys

Every key is granted only the scopes it needs. Tenant isolation is enforced at the database layer — your keys can never access another organization's data.

Idempotent by design

All mutating endpoints accept an idempotency_key. Retrying within 24 hours replays the original response without double-executing. Safe for unreliable networks.

Audit trail

Every API call — messages sent, actions executed, knowledge retrieved — is logged with a stable run ID. Full traceability for compliance.