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

###
