> For the complete documentation index, see [llms.txt](https://docs.mailtrap.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mailtrap.io/developers/inbound/inboxes/create-an-inbox.md).

# Create an inbox

Create a new inbox in a folder. Requires admin access to the folder. An account can have at most 300 inboxes.

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 one of the account's custom sending domains. The inbox then receives mail sent to any address on that domain, and its `address` is returned as `*@your-domain.com`. Each domain can be attached to only one inbox.

```json
{"openapi":"3.1.0","info":{"title":"Inbound","version":"2.0.0"},"tags":[{"name":"inboxes","description":"An inbox is the destination for inbound email. Each inbox is created\ninside a folder and gets a unique generated address that can receive\nmail from any sender.\n"}],"servers":[{"description":"Mailtrap API","url":"https://mailtrap.io"}],"security":[{"HeaderAuth":[]},{"BearerAuth":[]}],"components":{"securitySchemes":{"HeaderAuth":{"type":"apiKey","description":"API token in Api-Token header","in":"header","name":"Api-Token"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Bearer token authentication"}},"parameters":{"folder_id":{"name":"folder_id","in":"path","required":true,"description":"Inbound folder ID","schema":{"type":"integer"}}},"schemas":{"InboxCreateInput":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Inbox name. Must be unique within the account, across all folders."},"domain_id":{"type":"integer","description":"ID of one of the account's custom sending domains. Attaches the\ninbox to that domain, creating a catch-all inbox that receives mail\nfor any address on it. Omit to create a standard Mailtrap-hosted\ninbox. A domain can be attached to only one inbox; an unknown or\ninaccessible ID returns `422` with `domain_id: [\"does not exist\"]`.\n"}}},"Inbox":{"type":"object","required":["id","name","address","domain_id"],"properties":{"id":{"type":"integer"},"name":{"type":"string"},"address":{"type":"string","description":"The inbox's inbound address. For a standard Mailtrap-hosted inbox\nthis is a unique generated address. For a custom-domain inbox it is\nthe catch-all form `*@your-domain.com`, which receives mail sent to\nany address on that domain.\n"},"domain_id":{"type":"integer","description":"ID of the sending domain the inbox is attached to. For a\ncustom-domain inbox this is your own sending domain; for a standard\nhosted inbox it is the Mailtrap-managed domain backing the inbox.\n"}}},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}},"ForbiddenError":{"type":"object","properties":{"errors":{"type":"string"}}},"UnprocessableEntity":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"responses":{"Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Forbidden":{"description":"Forbidden. The token lacks the permission required for this operation\n(`Access forbidden`), has no access to the account\n(`Account access forbidden`), or Email API/SMTP is not enabled for the\norganization (empty response body).\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForbiddenError"}}}},"NotFound":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/api/inbound/folders/{folder_id}/inboxes":{"post":{"operationId":"createInboundInbox","summary":"Create an inbox","description":"Create a new inbox in a folder. Requires admin access to the folder.\nAn account can have at most 300 inboxes.\n\nBy default Mailtrap generates the inbox `address` automatically based\non the `name`.\n\nTo create a catch-all inbox on your own domain, pass `domain_id` — the\nID of one of the account's custom sending domains. The inbox then\nreceives mail sent to any address on that domain, and its `address` is\nreturned as `*@your-domain.com`. Each domain can be attached to only one\ninbox.\n","tags":["inboxes"],"parameters":[{"$ref":"#/components/parameters/folder_id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboxCreateInput"}}}},"responses":{"201":{"description":"Inbox created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Inbox"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnprocessableEntity"}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mailtrap.io/developers/inbound/inboxes/create-an-inbox.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
