Skip to content

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

  1. Create an API key in Account → API keys. Copy it when it is shown; it is shown only once.
  2. Save the key and the API address in your shell:
Shell
export MAILA_API_KEY="sk-..."
export MAILA_API_URL="https://api.maila.ai"
  1. Make your first request. It returns your plan and how many emails you have sent this month.
curl
curl "$MAILA_API_URL/v1/usage" \
  -H "Authorization: Bearer $MAILA_API_KEY"

Every example in these docs uses these two variables, 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 an object field 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 data and next_cursor. Pass ?cursor= with that value to get the next page; it is null on the last page.
  • Errors return {"error": { "type", "message" }}. See Errors and limits.

Endpoints