For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create an inbox

Create a new inbox in a folder. By default Mailtrap generates the inbox address automatically based on the name.

To create a catch-all inbox on your own domain, pass domain_id — the ID of a verified custom sending domain with inbound enabled. The inbox then receives mail sent to any address on that domain, and its address is returned as *@your-domain.com.

post
Authorizations
Api-TokenstringRequired

API token in Api-Token header

Path parameters
folder_idintegerRequired

Inbound folder ID

Example: 1
Body
namestring · max: 100RequiredExample: Support tickets
domain_idintegerOptional

Attach the inbox to a verified custom sending domain (one with inbound enabled), creating a catch-all inbox that receives mail for any address on that domain. Omit to create a standard Mailtrap-hosted inbox. Requires the custom domains feature.

Example: 894
Responses
201

Inbox created

application/json
idintegerOptionalExample: 1
namestringOptionalExample: Support tickets
addressstringOptional

The inbox's inbound address. For a standard Mailtrap-hosted inbox this is a unique generated address. For a custom-domain inbox it is the catch-all form *@your-domain.com, which receives mail sent to any address on that domain.

Example: support-tickets-1a2b3c4d@inbound-mailtrap.io
domain_idintegerOptional

ID of the sending domain the inbox is attached to. For a custom-domain inbox this is your own sending domain; for a standard hosted inbox it is the Mailtrap-managed domain backing the inbox.

Example: 892
post/api/inbound/folders/{folder_id}/inboxes
curl -X POST https://mailtrap.io/api/inbound/folders/{folder_id}/inboxes \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{ "name": "Support tickets" }'
{
  "id": 1,
  "name": "Support tickets",
  "address": "support-tickets-1a2b3c4d@inbound-mailtrap.io",
  "domain_id": 892
}

Last updated

Was this helpful?