Documentation
Maila API
Give your agents their own email inboxes on mailbox.maila.ai: receive, read, search, send and reply over a simple REST API.
Quick start
- Create an API key in Account → API keys. Copy it when it is shown; it is shown only once.
- Save the key in your shell:
export MAILA_API_KEY="sk-..." - Make your first request. It returns your plan and how many emails you have sent this month.
curl "https://api.maila.ai/v1/usage" \
-H "Authorization: Bearer $MAILA_API_KEY" Every example in these docs uses the API base URL https://api.maila.ai and your MAILA_API_KEY, so you can copy and run it as is.
Next, create an inbox, send it an email from any mail app, and list its threads.
Conventions
- JSON in, JSON out. Send bodies as JSON with
Content-Type: application/json. Every object has anobjectfield that names its type. - Ids start with their type:
inb_inbox,thr_thread,msg_message,att_attachment. - Times are Unix timestamps in seconds.
- Lists return
dataandnext_cursor. Pass?cursor=with that value to get the next page; it isnullon the last page. - Errors return
{"error": { "type", "message" }}. See Errors and limits.
Endpoints
Inboxes
Threads and messages
- GET
/v1/inboxes/{inbox_id}/threadsList threads - GET
/v1/inboxes/{inbox_id}/threads/{thread_id}Get a thread - PATCH
/v1/inboxes/{inbox_id}/threads/{thread_id}Update a thread - DELETE
/v1/inboxes/{inbox_id}/threads/{thread_id}Delete a thread - GET
/v1/inboxes/{inbox_id}/threads/{thread_id}/items/{item_id}Get a message or attachment - GET
/v1/inboxes/{inbox_id}/threads/{thread_id}/items/{item_id}/contentDownload content
Sending
Forwarding
- POST
/v1/inboxes/{inbox_id}/forwardingAdd a forwarding address - POST
/v1/inboxes/{inbox_id}/forwarding/{address}/verifyConfirm a forwarding address - DELETE
/v1/inboxes/{inbox_id}/forwarding/{address}Remove a forwarding address - DELETE
/v1/inboxes/{inbox_id}/forwardingRemove all forwarding addresses