# Web Cloud › Email and Collaborative Solutions › MX Plan › Zimbra platform › Aliases API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Web Cloud product's sections: https://developers.eu.ovhcloud.com/reference/web-cloud/llms.txt
> Everything in one file: https://developers.eu.ovhcloud.com/llms-full.txt

> 4 operations of the OVHcloud API. Calls carry `authorization: Bearer $OVH_TOKEN`; the EU host is shown, Canada and the United States answer on api.ca.ovhcloud.com and api.us.ovhcloud.com.

Page: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/zimbra-platform/aliases/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/web-cloud/email-and-collaborative-solutions/mx-plan/zimbra-platform/aliases.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/web-cloud/email-and-collaborative-solutions/mx-plan/zimbra-platform/aliases.json?format=openapi3

## Operations

- `GET /email/mxplan/{service}/account/{email}/alias` — List account aliases
- `GET /email/mxplan/{service}/account/{email}/alias/{alias}` — Get an account alias
- `POST /email/mxplan/{service}/account/{email}/alias` — Create an account alias
- `DELETE /email/mxplan/{service}/account/{email}/alias/{alias}` — Delete an account alias

## List account aliases

`GET /1.0/email/mxplan/{service}/account/{email}/alias`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/zimbra-platform/aliases/#get-email-mxplan-service-account-email-alias

**Status:** Stable production version  
**IAM actions:** `emailMxplan:apiovh:account/alias/get`

List account aliases. Returns the aliases of the email account: extra addresses that deliver to the same mailbox.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Default email for this mailbox |
| `service` | path | string | yes | The internal name of your mxplan organization |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | string[] | successful operation |

```json
[
  "string"
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/mxplan/{service}/account/{email}/alias" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/email/mxplan/{service}/account/{email}/alias")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/email/mxplan/{service}/account/{email}/alias");

print_r($result);
?>
```

## Get an account alias

`GET /1.0/email/mxplan/{service}/account/{email}/alias/{alias}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/zimbra-platform/aliases/#get-email-mxplan-service-account-email-alias-alias

**Status:** Stable production version  
**IAM actions:** `emailMxplan:apiovh:account/alias/get`

Get an account alias. Returns the alias address, its creation date and the ID of its pending task, if any (`taskPendingId`).

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `alias` | path | string | yes | Alias |
| `email` | path | string | yes | Default email for this mailbox |
| `service` | path | string | yes | The internal name of your mxplan organization |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.mxplan.AccountAlias | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `alias` | string | read-only | Alias |
| `creationDate` | string (date-time) | read-only | Creation date |
| `taskPendingId` | integer | read-only | Pending task id |

```json
{
  "alias": "string",
  "creationDate": "2024-01-01T12:00:00Z",
  "taskPendingId": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/mxplan/{service}/account/{email}/alias/{alias}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.get("/email/mxplan/{service}/account/{email}/alias/{alias}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->get("/email/mxplan/{service}/account/{email}/alias/{alias}");

print_r($result);
?>
```

## Create an account alias

`POST /1.0/email/mxplan/{service}/account/{email}/alias`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/zimbra-platform/aliases/#post-email-mxplan-service-account-email-alias

**Status:** Stable production version  
**IAM actions:** `emailMxplan:apiovh:account/alias/create`

Create an account alias. Adds the `alias` address to the email account, so that it receives its emails, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Default email for this mailbox |
| `service` | path | string | yes | The internal name of your mxplan organization |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `alias` | string | yes | Alias |

```json
{
  "alias": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.pro.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.pro.TaskFunctionEnum | read-only | Function name — one of `addAccount`, `addAlias`, `addDomain`, `addDomainDKIM`, `addDomainDisclaimer`, `addExternalContact`, `addFullAccess`, `addSendAs`, `addSendOnBehalfTo`, `addServiceAuthorizedIp`, `changeHostname`, `changePassword`, … |
| `id` | integer | read-only | Task id |
| `status` | email.pro.TaskStatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Creation date |

```json
{
  "finishDate": "2024-01-01T12:00:00Z",
  "function": "addAccount",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/mxplan/{service}/account/{email}/alias" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

# Request body type: string
result = client.post("/email/mxplan/{service}/account/{email}/alias",
	alias = None, # Alias (type: string)
)

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

// Request body type: string
$result = $ovh->post("/email/mxplan/{service}/account/{email}/alias", array(
	alias => null, // Alias (type: string)
));

print_r($result);
?>
```

## Delete an account alias

`DELETE /1.0/email/mxplan/{service}/account/{email}/alias/{alias}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/zimbra-platform/aliases/#delete-email-mxplan-service-account-email-alias-alias

**Status:** Stable production version  
**IAM actions:** `emailMxplan:apiovh:account/alias/delete`

Delete an account alias. Removes the alias address from the email account, which no longer receives its emails, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `alias` | path | string | yes | Alias |
| `email` | path | string | yes | Default email for this mailbox |
| `service` | path | string | yes | The internal name of your mxplan organization |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.pro.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.pro.TaskFunctionEnum | read-only | Function name — one of `addAccount`, `addAlias`, `addDomain`, `addDomainDKIM`, `addDomainDisclaimer`, `addExternalContact`, `addFullAccess`, `addSendAs`, `addSendOnBehalfTo`, `addServiceAuthorizedIp`, `changeHostname`, `changePassword`, … |
| `id` | integer | read-only | Task id |
| `status` | email.pro.TaskStatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Creation date |

```json
{
  "finishDate": "2024-01-01T12:00:00Z",
  "function": "addAccount",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/email/mxplan/{service}/account/{email}/alias/{alias}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

```python
'''
First, install the latest release of Python wrapper: $ pip install ovh
'''
import json
import ovh

# Instantiate an OVH Client.
# You can generate new credentials with full access to your account on
# the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
client = ovh.Client(
	endpoint='ovh-eu',               # Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
	application_key='xxxxxxxxxx',    # Application Key
	application_secret='xxxxxxxxxx', # Application Secret
	consumer_key='xxxxxxxxxx',       # Consumer Key
)

result = client.delete("/email/mxplan/{service}/account/{email}/alias/{alias}")

# Pretty print
print(json.dumps(result, indent=4))
```

```php
<?php
/**
 * First, download the latest release of PHP wrapper on github
 * And include this script into the folder with extracted files
 */
require __DIR__ . '/vendor/autoload.php';
use \Ovh\Api;

/**
 * Instantiate an OVH Client.
 * You can generate new credentials with full access to your account on
 * the token creation page (https://api.ovh.com/createToken/index.cgi?GET=/*&PUT=/*&POST=/*&DELETE=/*)
 */
$ovh = new Api('xxxxxxxxxx',  // Application Key
               'xxxxxxxxxx',  // Application Secret
               'ovh-eu',      // Endpoint of API OVH (List of available endpoints: https://github.com/ovh/python-ovh#2-configure-your-application)
               'xxxxxxxxxx'); // Consumer Key

$result = $ovh->delete("/email/mxplan/{service}/account/{email}/alias/{alias}");

print_r($result);
?>
```
