> For the complete documentation index, see [llms.txt](https://api-docs.devhub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.devhub.com/advanced/webmail.md).

# Webmail

## Email domains

The email domains resource is used to create the main email record for a domain (i.e. customerdomain.com) in which Email mailboxes will be created.

### Email domain model

A email domain object contains the following fields

| Attribute | Type    | Description                                           |
| --------- | ------- | ----------------------------------------------------- |
| id        | integer | Unique id of the email domain                         |
| domain    | string  | Domain for the email domain (i.e. customerdomain.com) |

#### Example object:

```json
{
    "id": 12345,
    "domain": "customerdomain.com"
}
```

## Create an Email domain

`POST /api/v2/email_domain/`

## List Email domains

List all email domains under an instance

`GET /api/v2/email_domain/`

## Email mailboxes

The email mailboxes resource is used to create the individual email mailboxes under an Email domain (example: <johndoe@customerdomain.com>)

### Email mailbox object

| Attribute  | Type    | Description                                                                                                       |
| ---------- | ------- | ----------------------------------------------------------------------------------------------------------------- |
| id         | integer | Unique ID for the email mailbox                                                                                   |
| domain\_id | integer | Email domain ID                                                                                                   |
| name       | string  | Mailbox name under the domain. Example: an email of <johndoe@customer.com> would have a `name` value of "johndoe" |

#### Example object:

```json
{
    "id": 54321,
    "domain_id": 12345,
    "name": "johndoe"
}
```

## Create Email mailbox

`POST /api/v2/email_mailbox/`

## List Email mailboxes

List all the email mailboxes under a domain

`GET /api/v2/email_mailbox/?domain=customerdomain.com`

## Delete Email mailbox

`DELETE /api/v2/email_mailbox/:email_mailbox_id/`

## &#x20;

###


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://api-docs.devhub.com/advanced/webmail.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
