Inboxes
An inbox is an email address on mailbox.maila.ai that your agent can receive and send from.
Create an inbox #
POST
/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. -
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.
- Role names such as
postmaster,abuseandnoreplyare reserved. - An address belongs to one inbox for good. If it is taken, you get
409.
curl -X POST "$MAILA_API_URL/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",
"created_at": 1792335167,
"updated_at": 1792335167
} List inboxes #
GET
/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 "$MAILA_API_URL/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 #
GET
/v1/inboxes/{inbox_id} Returns one inbox.
Path parameters
-
inbox_idstring required - The inbox, for example
inb_mvdlh9c06724trm1.
curl "$MAILA_API_URL/v1/inboxes/inb_mvdlh9c06724trm1" \
-H "Authorization: Bearer $MAILA_API_KEY" Update an inbox #
PATCH
/v1/inboxes/{inbox_id} Changes the display name, instructions or categories. 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.
curl -X PATCH "$MAILA_API_URL/v1/inboxes/inb_mvdlh9c06724trm1" \
-H "Authorization: Bearer $MAILA_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "display_name": "Billing Support" }' Disable an inbox #
DELETE
/v1/inboxes/{inbox_id} 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 DELETE "$MAILA_API_URL/v1/inboxes/inb_mvdlh9c06724trm1" \
-H "Authorization: Bearer $MAILA_API_KEY" { "object": "inbox", "id": "inb_mvdlh9c06724trm1", "status": "disabled" }