Inboxes
An inbox is an email address on mailbox.maila.ai that your agent can receive and send from.
Create an inbox #
/v1/inboxes Creates an inbox at <local_part>@mailbox.maila.ai. It can receive email right away. Returns 201.
Body
-
local_partstring - The part before the @. Lowercase letters, digits,
.,_and-, up to 64 characters. Leave it out for a random address. -
domainstring - The part after the @, one of the domains from List domains. Default
mailbox.maila.ai. It cannot change later. -
display_namestring - The sender name recipients see. Up to 100 characters.
-
instructionsstring - Notes for your agent about this inbox. Up to 10,000 characters.
-
categoriesstring[] - Up to 20 category names you use to organize threads.
-
agent_modestring - What the inbox agent does with received email.
offdoes nothing.classifyadds a category, labels, a summary and the details your instructions ask for.replydoes the same and may answer the sender once when your instructions say so. -
firewallobject - Which senders the inbox accepts and whom it may email, as
inboundandoutboundrules. Each has adefault(allowordeny) andallowanddenypatterns such as@example.com;inboundalso has anaction,quarantineordrop. Replaces the whole firewall;nullremoves it.
- Role names such as
postmaster,abuseandnoreplyare reserved. - An address is never given to another account. If it is taken, you get
409. - A domain that is not enabled for your account returns
403.
curl -X POST "https://api.maila.ai/v1/inboxes" \
-H "Authorization: Bearer $MAILA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"local_part": "support-agent",
"display_name": "Support Agent",
"instructions": "Answer billing questions politely."
}' {
"object": "inbox",
"id": "inb_mvdlh9c06724trm1",
"address": "support-agent@mailbox.maila.ai",
"display_name": "Support Agent",
"instructions": "Answer billing questions politely.",
"categories": [],
"status": "active",
"agent_mode": "off",
"forwarding_addresses": [],
"forwarded_count": 0,
"forwarding_verification": "code",
"firewall": null,
"created_at": 1792335167,
"updated_at": 1792335167
} List inboxes #
/v1/inboxes Returns your inboxes, oldest first.
Query parameters
-
limitinteger - Results per page, 1–100. Default 20.
-
cursorstring - The
next_cursorfrom the previous page.
curl "https://api.maila.ai/v1/inboxes?limit=20" \
-H "Authorization: Bearer $MAILA_API_KEY" {
"object": "list",
"data": [
{ "object": "inbox", "id": "inb_mvdlh9c06724trm1", "address": "support-agent@mailbox.maila.ai", "status": "active" }
],
"next_cursor": null
} Get an inbox #
/v1/inboxes/{inbox_id} Returns one inbox.
Path parameters
-
inbox_idstring required - The inbox, for example
inb_mvdlh9c06724trm1.
curl "https://api.maila.ai/v1/inboxes/inb_mvdlh9c06724trm1" \
-H "Authorization: Bearer $MAILA_API_KEY" {
"object": "inbox",
"id": "inb_mvdlh9c06724trm1",
"address": "support-agent@mailbox.maila.ai",
"display_name": "Support Agent",
"instructions": "Answer billing questions politely.",
"categories": [],
"status": "active",
"agent_mode": "off",
"forwarding_addresses": [],
"forwarded_count": 0,
"forwarding_verification": "code",
"firewall": null,
"created_at": 1792335167,
"updated_at": 1792335167
} Update an inbox #
/v1/inboxes/{inbox_id} Changes the display name, instructions, categories, agent mode or firewall. Send only the fields you want to change. The address cannot change.
Path parameters
-
inbox_idstring required - The inbox, for example
inb_mvdlh9c06724trm1.
Body
-
display_namestring - Up to 100 characters.
-
instructionsstring - Up to 10,000 characters.
-
categoriesstring[] - Replaces the list. Up to 20 names.
-
agent_modestring - What the inbox agent does with received email.
offdoes nothing.classifyadds a category, labels, a summary and the details your instructions ask for.replydoes the same and may answer the sender once when your instructions say so. -
firewallobject - Which senders the inbox accepts and whom it may email, as
inboundandoutboundrules. Each has adefault(allowordeny) andallowanddenypatterns such as@example.com;inboundalso has anaction,quarantineordrop. Replaces the whole firewall;nullremoves it.
curl -X PATCH "https://api.maila.ai/v1/inboxes/inb_mvdlh9c06724trm1" \
-H "Authorization: Bearer $MAILA_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "display_name": "Billing Support" }' {
"object": "inbox",
"id": "inb_mvdlh9c06724trm1",
"address": "support-agent@mailbox.maila.ai",
"display_name": "Support Agent",
"instructions": "Answer billing questions politely.",
"categories": [],
"status": "active",
"agent_mode": "off",
"forwarding_addresses": [],
"forwarded_count": 0,
"forwarding_verification": "code",
"firewall": null,
"created_at": 1792335167,
"updated_at": 1792335167
} Disable an inbox #
/v1/inboxes/{inbox_id}/disable Stops the inbox from receiving and sending email. Its threads stay readable, and the address stays reserved for you; it is never given to anyone else.
Path parameters
-
inbox_idstring required - The inbox, for example
inb_mvdlh9c06724trm1.
curl -X POST "https://api.maila.ai/v1/inboxes/inb_mvdlh9c06724trm1/disable" \
-H "Authorization: Bearer $MAILA_API_KEY" { "object": "inbox", "id": "inb_mvdlh9c06724trm1", "status": "disabled" } Delete an inbox #
/v1/inboxes/{inbox_id} Deletes the inbox and, in the background, all its threads, messages, attachments and files. This cannot be undone. Returns 202.
Path parameters
-
inbox_idstring required - The inbox, for example
inb_mvdlh9c06724trm1.
- From the first call, every route treats the inbox as not found and it leaves your list.
- The address stays reserved for you, and you can create it again at once as a new inbox. No other account can ever use it.
curl -X DELETE "https://api.maila.ai/v1/inboxes/inb_mvdlh9c06724trm1" \
-H "Authorization: Bearer $MAILA_API_KEY" { "object": "inbox", "id": "inb_mvdlh9c06724trm1", "status": "deleting" } List domains #
/v1/domains Returns the domains you can create inboxes on: always mailbox.maila.ai, plus any other domain enabled for your account. This list is not paged.
curl "https://api.maila.ai/v1/domains" \
-H "Authorization: Bearer $MAILA_API_KEY" {
"object": "list",
"data": [
{ "object": "domain", "domain": "mailbox.maila.ai", "default": true }
],
"next_cursor": null
}