Managing email accounts over the API
Types of mailboxes
In our API, we differentiate between two types of mailboxes:
- E-Mail adresses are used to send and receive emails. They are either associated with a mailbox (that you can connect to using an email client) or with a forwarding address (that forwards all incoming emails to one or more other email addresses).
 - Delivery boxes are used to send emails. They are used to send emails from a web application or a script.
 
Requirements
To manage email accounts, you will need an existing project. You can create a new project using the Creating a project guide.
Create a new email account
To create a new email account, send a request to the POST/ endpoint. The request body must contain a JSON object with the following properties:
- Schema documentation
 - Example
 
- addressstring (idn-email)required
 - forwardAddressesarray of string (idn-email)
- Array[
 - *string (idn-email)
 
] 
- enableSpamProtectionbooleanrequired
 - passwordstringrequired
 - quotaInBytesinteger (≥ -1, int64)required
2 GB
 
{
  "address": "email@mittwald.example",
  "forwardAddresses": [
    "email@mittwald.example"
  ],
  "isCatchAll": true,
  "mailbox": {
    "enableSpamProtection": true,
    "password": "string",
    "quotaInBytes": 2147483648
  }
}
Create a new forwarding address
A forwarding address is an email address that forwards all incoming emails to one or more other email addresses. To create a new forwarding address, send a request to the POST/ endpoint. The request body must contain a JSON object with the following properties:
- Schema documentation
 - Example
 
- addressstring (idn-email)required
 - forwardAddressesarray of string (idn-email)required
- Array[
 - *string (idn-email)
 
] 
{
  "address": "email@mittwald.example",
  "forwardAddresses": [
    "email@mittwald.example"
  ]
}
Create a new delivery box
A delivery box is an email address that can be used to send emails from a web application or a script. To create a new delivery box, send a request to the POST/ endpoint. The request body must contain a JSON object with the following properties:
description(string, required): A description for the delivery box. This description will be displayed in the web interface.password(string, required): The password for the delivery box. This password will be used to authenticate against the SMTP server.
Deleting email accounts
To delete an email address or a delivery box, send a request to the DELETE/ or  DELETE/ endpoint, respectively. The id parameter must contain the ID of the email address or delivery box you want to delete. No request body is needed.