# 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
