# Web Cloud › Email and Collaborative Solutions › Zimbra › 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/zimbra/aliases/

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

## Operations

- `GET /zimbra/platform/{platformId}/alias` — List aliases
- `GET /zimbra/platform/{platformId}/alias/{aliasId}` — Get an alias
- `POST /zimbra/platform/{platformId}/alias` — Create an alias
- `DELETE /zimbra/platform/{platformId}/alias/{aliasId}` — Delete an alias

## List aliases

`GET /v2/zimbra/platform/{platformId}/alias`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/zimbra/aliases/#get-zimbra-platform-platformid-alias

**Status:** Stable production version  
**IAM actions:** `zimbra:apiovh:platform/alias/get`

Returns the aliases of the platform with their target. Filter them by `alias`, `aliasTargetId`, `aliasOrganizationId` or `aliasOrganizationLabel`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `alias` | query | string |  | Filter by the alias email |
| `aliasOrganizationId` | query | string |  | Filter by organization identifier of the aliases |
| `aliasOrganizationLabel` | query | string |  | Filter by organization label of the aliases |
| `aliasTargetId` | query | string |  | Filter by the targeted email account identifier |
| `platformId` | path | string (uuid) | yes | Platform ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | zimbra.AliasResponse[] | successful operation |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Checksum hash in MD5 representation |
| `currentState` | zimbra.Alias | read-only | Object representing Alias |
| `currentState.alias` | zimbra.AliasSource | read-only | The alias |
| `currentState.alias.domainId` | string (uuid) | read-only | The domain's id to which alias belong |
| `currentState.alias.name` | string | read-only | The email used for the alias |
| `currentState.alias.organizationId` | string (uuid) | read-only | The organization's id to which alias belong |
| `currentState.alias.organizationLabel` | string | read-only | The organization's label to which alias belong |
| `currentState.target` | zimbra.AliasTarget | read-only | The alias's target |
| `currentState.target.domainId` | string (uuid) | read-only | The id of the domain id to which the target account belongs |
| `currentState.target.id` | string (uuid) | read-only | The id of target object of the alias |
| `currentState.target.type` | zimbra.AliasTypeEnum | read-only | The type of target object of the alias — one of `ACCOUNT`, `MAILING_LIST` |
| `currentTasks` | common.CurrentTask[] | read-only | An array containing tasks responses pending on resource extends AsyncResourceBase object |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Resource identifier in UUID representation |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Current resource status — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | zimbra.AliasBase | read-only | Object representing Alias |
| `targetSpec.alias` | string | yes | The alias |
| `targetSpec.targetId` | string (uuid) | yes | The target object of the alias |

```json
[
  {
    "checksum": "string",
    "currentState": {
      "alias": {
        "domainId": "00000000-0000-0000-0000-000000000000",
        "name": "string",
        "organizationId": "00000000-0000-0000-0000-000000000000",
        "organizationLabel": "string"
      },
      "target": {
        "domainId": "00000000-0000-0000-0000-000000000000",
        "id": "00000000-0000-0000-0000-000000000000",
        "type": "ACCOUNT"
      }
    },
    "currentTasks": [
      {
        "errors": [
          {
            "message": "string"
          }
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "link": "string",
        "status": "ERROR",
        "type": "string"
      }
    ],
    "id": "00000000-0000-0000-0000-000000000000",
    "resourceStatus": "CREATING",
    "targetSpec": {
      "alias": "string",
      "targetId": "00000000-0000-0000-0000-000000000000"
    }
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/zimbra/platform/{platformId}/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("/v2/zimbra/platform/{platformId}/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("/v2/zimbra/platform/{platformId}/alias");

print_r($result);
?>
```

## Get an alias

`GET /v2/zimbra/platform/{platformId}/alias/{aliasId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/zimbra/aliases/#get-zimbra-platform-platformid-alias-aliasid

**Status:** Stable production version  
**IAM actions:** `zimbra:apiovh:platform/alias/get`

Returns the alias address, its domain and organization, and its target: an email account or a mailing list.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `aliasId` | path | string (uuid) | yes | Alias ID |
| `platformId` | path | string (uuid) | yes | Platform ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | zimbra.AliasResponse | successful operation |
| 400 | object | Error 400 response |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Checksum hash in MD5 representation |
| `currentState` | zimbra.Alias | read-only | Object representing Alias |
| `currentState.alias` | zimbra.AliasSource | read-only | The alias |
| `currentState.alias.domainId` | string (uuid) | read-only | The domain's id to which alias belong |
| `currentState.alias.name` | string | read-only | The email used for the alias |
| `currentState.alias.organizationId` | string (uuid) | read-only | The organization's id to which alias belong |
| `currentState.alias.organizationLabel` | string | read-only | The organization's label to which alias belong |
| `currentState.target` | zimbra.AliasTarget | read-only | The alias's target |
| `currentState.target.domainId` | string (uuid) | read-only | The id of the domain id to which the target account belongs |
| `currentState.target.id` | string (uuid) | read-only | The id of target object of the alias |
| `currentState.target.type` | zimbra.AliasTypeEnum | read-only | The type of target object of the alias — one of `ACCOUNT`, `MAILING_LIST` |
| `currentTasks` | common.CurrentTask[] | read-only | An array containing tasks responses pending on resource extends AsyncResourceBase object |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Resource identifier in UUID representation |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Current resource status — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | zimbra.AliasBase | read-only | Object representing Alias |
| `targetSpec.alias` | string | yes | The alias |
| `targetSpec.targetId` | string (uuid) | yes | The target object of the alias |

```json
{
  "checksum": "string",
  "currentState": {
    "alias": {
      "domainId": "00000000-0000-0000-0000-000000000000",
      "name": "string",
      "organizationId": "00000000-0000-0000-0000-000000000000",
      "organizationLabel": "string"
    },
    "target": {
      "domainId": "00000000-0000-0000-0000-000000000000",
      "id": "00000000-0000-0000-0000-000000000000",
      "type": "ACCOUNT"
    }
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "alias": "string",
    "targetId": "00000000-0000-0000-0000-000000000000"
  }
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/zimbra/platform/{platformId}/alias/{aliasId}" \
  -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("/v2/zimbra/platform/{platformId}/alias/{aliasId}")

# 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("/v2/zimbra/platform/{platformId}/alias/{aliasId}");

print_r($result);
?>
```

## Create an alias

`POST /v2/zimbra/platform/{platformId}/alias`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/zimbra/aliases/#post-zimbra-platform-platformid-alias

**Status:** Stable production version  
**IAM actions:** `zimbra:apiovh:platform/alias/create`

Creates an alias address from `alias` and the ID of its target in `targetId`. The alias domain and the target domain must be in the same organization.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `platformId` | path | string (uuid) | yes | Platform ID |

### Request body (required)

Type: `zimbra.AliasPostPayload`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `targetSpec` | zimbra.AliasBase | yes | Target alias specification |
| `targetSpec.alias` | string | yes | The alias |
| `targetSpec.targetId` | string (uuid) | yes | The target object of the alias |

```json
{
  "targetSpec": {
    "alias": "string",
    "targetId": "00000000-0000-0000-0000-000000000000"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | zimbra.AliasResponse | successful operation |
| 400 | object | Error 400 response |
| 404 | object | Error 404 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Checksum hash in MD5 representation |
| `currentState` | zimbra.Alias | read-only | Object representing Alias |
| `currentState.alias` | zimbra.AliasSource | read-only | The alias |
| `currentState.alias.domainId` | string (uuid) | read-only | The domain's id to which alias belong |
| `currentState.alias.name` | string | read-only | The email used for the alias |
| `currentState.alias.organizationId` | string (uuid) | read-only | The organization's id to which alias belong |
| `currentState.alias.organizationLabel` | string | read-only | The organization's label to which alias belong |
| `currentState.target` | zimbra.AliasTarget | read-only | The alias's target |
| `currentState.target.domainId` | string (uuid) | read-only | The id of the domain id to which the target account belongs |
| `currentState.target.id` | string (uuid) | read-only | The id of target object of the alias |
| `currentState.target.type` | zimbra.AliasTypeEnum | read-only | The type of target object of the alias — one of `ACCOUNT`, `MAILING_LIST` |
| `currentTasks` | common.CurrentTask[] | read-only | An array containing tasks responses pending on resource extends AsyncResourceBase object |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Resource identifier in UUID representation |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Current resource status — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | zimbra.AliasBase | read-only | Object representing Alias |
| `targetSpec.alias` | string | yes | The alias |
| `targetSpec.targetId` | string (uuid) | yes | The target object of the alias |

```json
{
  "checksum": "string",
  "currentState": {
    "alias": {
      "domainId": "00000000-0000-0000-0000-000000000000",
      "name": "string",
      "organizationId": "00000000-0000-0000-0000-000000000000",
      "organizationLabel": "string"
    },
    "target": {
      "domainId": "00000000-0000-0000-0000-000000000000",
      "id": "00000000-0000-0000-0000-000000000000",
      "type": "ACCOUNT"
    }
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "alias": "string",
    "targetId": "00000000-0000-0000-0000-000000000000"
  }
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/zimbra/platform/{platformId}/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: zimbra.AliasPostPayload
result = client.post("/v2/zimbra/platform/{platformId}/alias",
	targetSpec = None, # Target alias specification (type: zimbra.AliasBase)
)

# 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: zimbra.AliasPostPayload
$result = $ovh->post("/v2/zimbra/platform/{platformId}/alias", array(
	targetSpec => null, // Target alias specification (type: zimbra.AliasBase)
));

print_r($result);
?>
```

## Delete an alias

`DELETE /v2/zimbra/platform/{platformId}/alias/{aliasId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/zimbra/aliases/#delete-zimbra-platform-platformid-alias-aliasid

**Status:** Stable production version  
**IAM actions:** `zimbra:apiovh:platform/alias/delete`

Deletes the alias address. The alias, its domain and its target must be ready.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `aliasId` | path | string (uuid) | yes | Alias ID |
| `platformId` | path | string (uuid) | yes | Platform ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | — | successful operation |

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/v2/zimbra/platform/{platformId}/alias/{aliasId}" \
  -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("/v2/zimbra/platform/{platformId}/alias/{aliasId}")

# 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("/v2/zimbra/platform/{platformId}/alias/{aliasId}");

print_r($result);
?>
```
