# Web Cloud › Email and Collaborative Solutions › MX Plan › Roundcube platform › Accounts 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

> 18 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/roundcube-platform/accounts/

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

## Operations

- `GET /email/domain/{domain}/account` — List email accounts
- `GET /email/domain/{domain}/account/{accountName}` — Get an email account
- `POST /email/domain/{domain}/account` — Create an email account
- `DELETE /email/domain/{domain}/account/{accountName}` — Delete an email account
- `PUT /email/domain/{domain}/account/{accountName}` — Update an email account
- `POST /email/domain/{domain}/account/{accountName}/changePassword` — Change an email account password
- `GET /email/domain/{domain}/account/{accountName}/delegation` — List delegations
- `GET /email/domain/{domain}/account/{accountName}/delegation/{accountId}` — Get a delegation
- `POST /email/domain/{domain}/account/{accountName}/delegation` — Create a delegation
- `DELETE /email/domain/{domain}/account/{accountName}/delegation/{accountId}` — Remove a delegation
- `GET /email/domain/{domain}/account/{accountName}/migrate` — List migration destinations
- `GET /email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}` — Get a migration destination
- `GET /email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress` — List destination email accounts
- `GET /email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress/{destinationEmailAddress}` — Get a destination email account
- `GET /email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress/{destinationEmailAddress}/checkMigrate` — Check an email account migration
- `POST /email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress/{destinationEmailAddress}/migrate` — Migrate an email account
- `POST /email/domain/{domain}/account/{accountName}/updateUsage` — Refresh email account usage
- `GET /email/domain/{domain}/account/{accountName}/usage` — Get email account usage

## List email accounts

`GET /1.0/email/domain/{domain}/account`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/accounts/#get-email-domain-domain-account

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

List email accounts. Returns the names of the email accounts of the domain. Filter them by `accountName` or `description`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountName` | query | string |  | Account name |
| `description` | query | string |  | Account description |
| `domain` | path | string | yes | Name of your domain name |

### Responses

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

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

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/domain/{domain}/account" \
  -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/domain/{domain}/account")

# 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/domain/{domain}/account");

print_r($result);
?>
```

## Get an email account

`GET /1.0/email/domain/{domain}/account/{accountName}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/accounts/#get-email-domain-domain-account-accountname

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

Get an email account. Returns the email address, description, size in bytes and blocked state of the email account.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountName` | path | string | yes | Name of account |
| `domain` | path | string | yes | Name of your domain name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.Account | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accountName` | string | read-only | Name of account |
| `description` | string |  | Account description |
| `domain` | string | read-only | Name of domain |
| `email` | string | read-only | Email |
| `isBlocked` | boolean | read-only | If true your account is blocked |
| `size` | integer |  | Size of your account in bytes |

```json
{
  "accountName": "string",
  "description": "string",
  "domain": "string",
  "email": "string",
  "isBlocked": true,
  "size": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/domain/{domain}/account/{accountName}" \
  -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/domain/{domain}/account/{accountName}")

# 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/domain/{domain}/account/{accountName}");

print_r($result);
?>
```

## Create an email account

`POST /1.0/email/domain/{domain}/account`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/accounts/#post-email-domain-domain-account

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

Create an email account. Creates an email account with a name, a password, and optionally a description and a size in bytes, and returns the task. The size is 5 GB by default; the allowed sizes are in `allowedAccountSize` of the email domain. The password needs 8 to 30 characters and no accents.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `domain` | path | string | yes | Name of your domain name |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accountName` | string | yes | Account name |
| `description` | string |  | Description Account |
| `password` | string (password) | yes | Account password |
| `size` | integer |  | Account size in bytes (default : 5000000000) (possible values : /email/domain/{domain}/allowedAccountSize ) |

```json
{
  "accountName": "string",
  "description": "string",
  "password": "string",
  "size": 0
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.TaskPop | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | domain.DomainPopActionEnum | read-only | Action of task — one of `addAccount`, `changeAccount`, `changePassword`, `deleteAccount`, `internalMigration`, `migration`, `temporaryTask`, `unknown` |
| `date` | string (date-time) | read-only | Creation date of task |
| `domain` | string | read-only | Domain name of task |
| `id` | integer | read-only | Id of task |
| `name` | string | read-only | Account name of task |

```json
{
  "action": "addAccount",
  "date": "2024-01-01T12:00:00Z",
  "domain": "string",
  "id": 0,
  "name": "string"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/domain/{domain}/account" \
  -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
)

result = client.post("/email/domain/{domain}/account",
	accountName = None, # Account name (type: string)
	description = None, # Description Account (type: string, nullable)
	password = None, # Account password (type: password)
	size = None, # Account size in bytes (default : 5000000000) (possible values : /email/domain/{domain}/allowedAccountSize ) (type: long, nullable)
)

# 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->post("/email/domain/{domain}/account", array(
	accountName => null, // Account name (type: string)
	description => null, // Description Account (type: string, nullable)
	password => null, // Account password (type: password)
	size => null, // Account size in bytes (default : 5000000000) (possible values : /email/domain/{domain}/allowedAccountSize ) (type: long, nullable)
));

print_r($result);
?>
```

## Delete an email account

`DELETE /1.0/email/domain/{domain}/account/{accountName}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/accounts/#delete-email-domain-domain-account-accountname

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

Delete an email account. Deletes the email account of the domain and returns the task. Follow it under `task/account/{id}`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountName` | path | string | yes | Name of account |
| `domain` | path | string | yes | Name of your domain name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.TaskPop | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | domain.DomainPopActionEnum | read-only | Action of task — one of `addAccount`, `changeAccount`, `changePassword`, `deleteAccount`, `internalMigration`, `migration`, `temporaryTask`, `unknown` |
| `date` | string (date-time) | read-only | Creation date of task |
| `domain` | string | read-only | Domain name of task |
| `id` | integer | read-only | Id of task |
| `name` | string | read-only | Account name of task |

```json
{
  "action": "addAccount",
  "date": "2024-01-01T12:00:00Z",
  "domain": "string",
  "id": 0,
  "name": "string"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/email/domain/{domain}/account/{accountName}" \
  -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/domain/{domain}/account/{accountName}")

# 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/domain/{domain}/account/{accountName}");

print_r($result);
?>
```

## Update an email account

`PUT /1.0/email/domain/{domain}/account/{accountName}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/accounts/#put-email-domain-domain-account-accountname

**Status:** Stable production version  
**IAM actions:** `emailDomain:apiovh:account/edit`

Update an email account. Updates the description or the size in bytes of the email account. The allowed sizes are in `allowedAccountSize` of the email domain.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountName` | path | string | yes | Name of account |
| `domain` | path | string | yes | Name of your domain name |

### Request body (required)

Type: `email.domain.Account`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accountName` | string | read-only | Name of account |
| `description` | string |  | Account description |
| `domain` | string | read-only | Name of domain |
| `email` | string | read-only | Email |
| `isBlocked` | boolean | read-only | If true your account is blocked |
| `size` | integer |  | Size of your account in bytes |

```json
{
  "description": "string",
  "size": 0
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/email/domain/{domain}/account/{accountName}" \
  -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: email.domain.Account
result = client.put("/email/domain/{domain}/account/{accountName}",
	description = None, # Account description (type: string)
	size = None, # Size of your account in bytes (type: integer)
)

# 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: email.domain.Account
$result = $ovh->put("/email/domain/{domain}/account/{accountName}", array(
	description => null, // Account description (type: string)
	size => null, // Size of your account in bytes (type: integer)
));

print_r($result);
?>
```

## Change an email account password

`POST /1.0/email/domain/{domain}/account/{accountName}/changePassword`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/accounts/#post-email-domain-domain-account-accountname-changepassword

**Status:** Stable production version  
**IAM actions:** `emailDomain:apiovh:account/changePassword`

Change an email account password. Sets a new password and returns the task. The password needs 8 to 30 characters and no accents.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountName` | path | string | yes | Name of account |
| `domain` | path | string | yes | Name of your domain name |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `password` | string (password) | yes | New password |

```json
{
  "password": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.TaskPop | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | domain.DomainPopActionEnum | read-only | Action of task — one of `addAccount`, `changeAccount`, `changePassword`, `deleteAccount`, `internalMigration`, `migration`, `temporaryTask`, `unknown` |
| `date` | string (date-time) | read-only | Creation date of task |
| `domain` | string | read-only | Domain name of task |
| `id` | integer | read-only | Id of task |
| `name` | string | read-only | Account name of task |

```json
{
  "action": "addAccount",
  "date": "2024-01-01T12:00:00Z",
  "domain": "string",
  "id": 0,
  "name": "string"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/domain/{domain}/account/{accountName}/changePassword" \
  -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: password
result = client.post("/email/domain/{domain}/account/{accountName}/changePassword",
	password = None, # New password (type: password)
)

# 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: password
$result = $ovh->post("/email/domain/{domain}/account/{accountName}/changePassword", array(
	password => null, // New password (type: password)
));

print_r($result);
?>
```

## List delegations

`GET /1.0/email/domain/{domain}/account/{accountName}/delegation`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/accounts/#get-email-domain-domain-account-accountname-delegation

**Status:** Stable production version  
**IAM actions:** `emailDomain:apiovh:account/delegation/get`

List delegations. Returns the OVHcloud account IDs (`accountId`) that have been delegated the management of the email account.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountName` | path | string | yes | Name of account |
| `domain` | path | string | yes | Name of your domain name |

### Responses

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

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

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/domain/{domain}/account/{accountName}/delegation" \
  -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/domain/{domain}/account/{accountName}/delegation")

# 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/domain/{domain}/account/{accountName}/delegation");

print_r($result);
?>
```

## Get a delegation

`GET /1.0/email/domain/{domain}/account/{accountName}/delegation/{accountId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/accounts/#get-email-domain-domain-account-accountname-delegation-accountid

**Status:** Stable production version  
**IAM actions:** `emailDomain:apiovh:account/delegation/get`

Get a delegation. Returns the OVHcloud account ID (`accountId`) that has been delegated the management of the email account.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string | yes | OVH customer unique identifier |
| `accountName` | path | string | yes | Name of account |
| `domain` | path | string | yes | Name of your domain name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.Delegation | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accountId` | string | read-only | OVH customer unique identifier |

```json
{
  "accountId": "string"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/domain/{domain}/account/{accountName}/delegation/{accountId}" \
  -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/domain/{domain}/account/{accountName}/delegation/{accountId}")

# 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/domain/{domain}/account/{accountName}/delegation/{accountId}");

print_r($result);
?>
```

## Create a delegation

`POST /1.0/email/domain/{domain}/account/{accountName}/delegation`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/accounts/#post-email-domain-domain-account-accountname-delegation

**Status:** Stable production version  
**IAM actions:** `emailDomain:apiovh:account/delegation/create`

Create a delegation. Gives the OVHcloud account `accountId` the management of the email account, from its own control panel.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountName` | path | string | yes | Name of account |
| `domain` | path | string | yes | Name of your domain name |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accountId` | string | yes | OVH customer unique identifier |

```json
{
  "accountId": "string"
}
```

### Responses

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

```json
"string"
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/domain/{domain}/account/{accountName}/delegation" \
  -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: coreTypes.AccountId:string
result = client.post("/email/domain/{domain}/account/{accountName}/delegation",
	accountId = None, # OVH customer unique identifier (type: coreTypes.AccountId: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: coreTypes.AccountId:string
$result = $ovh->post("/email/domain/{domain}/account/{accountName}/delegation", array(
	accountId => null, // OVH customer unique identifier (type: coreTypes.AccountId:string)
));

print_r($result);
?>
```

## Remove a delegation

`DELETE /1.0/email/domain/{domain}/account/{accountName}/delegation/{accountId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/accounts/#delete-email-domain-domain-account-accountname-delegation-accountid

**Status:** Stable production version  
**IAM actions:** `emailDomain:apiovh:account/delegation/delete`

Remove a delegation. Withdraws from the OVHcloud account the management of the email account that it had been delegated.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string | yes | OVH customer unique identifier |
| `accountName` | path | string | yes | Name of account |
| `domain` | path | string | yes | Name of your domain name |

### Responses

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

```json
"string"
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/email/domain/{domain}/account/{accountName}/delegation/{accountId}" \
  -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/domain/{domain}/account/{accountName}/delegation/{accountId}")

# 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/domain/{domain}/account/{accountName}/delegation/{accountId}");

print_r($result);
?>
```

## List migration destinations

`GET /1.0/email/domain/{domain}/account/{accountName}/migrate`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/accounts/#get-email-domain-domain-account-accountname-migrate

**Status:** Beta version  
**IAM actions:** `emailDomain:apiovh:account/migrate/get`

List migration destinations. Returns the names of the services the email account can be migrated to. Filter them by `type`: Email Pro, hosted, private or provider Exchange.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountName` | path | string | yes | Name of account |
| `domain` | path | string | yes | Name of your domain name |
| `type` | query | email.domain.MigrationServiceType |  | Type of migration service — one of `EMAIL PRO`, `HOSTED EXCHANGE`, `PRIVATE EXCHANGE`, `PROVIDER EXCHANGE` |

### Responses

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

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

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/domain/{domain}/account/{accountName}/migrate" \
  -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/domain/{domain}/account/{accountName}/migrate")

# 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/domain/{domain}/account/{accountName}/migrate");

print_r($result);
?>
```

## Get a migration destination

`GET /1.0/email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/accounts/#get-email-domain-domain-account-accountname-migrate-destinationservicename

**Status:** Beta version  
**IAM actions:** `emailDomain:apiovh:account/migrate/get`

Get a migration destination. Returns the offer type, creation and expiration dates, and admin, tech and billing contacts of the destination service.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountName` | path | string | yes | Name of account |
| `destinationServiceName` | path | string | yes | Service name allowed as migration destination |
| `domain` | path | string | yes | Name of your domain name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.MigrationService | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `contactAdmin` | string | read-only | Admin contact of service |
| `contactBilling` | string | read-only | Billing contact of service |
| `contactTech` | string | read-only | Tech contact of service |
| `creation` | string (date) | read-only | Creation date of service |
| `destinationServiceName` | string | read-only | Service name allowed as migration destination |
| `expiration` | string (date) | read-only | Expiration date of service |
| `type` | email.domain.MigrationServiceType | read-only | Offer type of service — one of `EMAIL PRO`, `HOSTED EXCHANGE`, `PRIVATE EXCHANGE`, `PROVIDER EXCHANGE` |

```json
{
  "contactAdmin": "string",
  "contactBilling": "string",
  "contactTech": "string",
  "creation": "2024-01-01",
  "destinationServiceName": "string",
  "expiration": "2024-01-01",
  "type": "EMAIL PRO"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}" \
  -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/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}")

# 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/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}");

print_r($result);
?>
```

## List destination email accounts

`GET /1.0/email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/accounts/#get-email-domain-domain-account-accountname-migrate-destinationservicename-destinationemailaddress

**Status:** Beta version  
**IAM actions:** `emailDomain:apiovh:account/migrate/destinationEmailAddress/get`

List destination email accounts. Returns the email addresses of the destination service the email account can be migrated to. Filter them by minimum size with `quota`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountName` | path | string | yes | Name of account |
| `destinationServiceName` | path | string | yes | Service name allowed as migration destination |
| `domain` | path | string | yes | Name of your domain name |
| `quota` | query | integer |  | Account maximum size |

### Responses

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

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

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress" \
  -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/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress")

# 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/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress");

print_r($result);
?>
```

## Get a destination email account

`GET /1.0/email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress/{destinationEmailAddress}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/accounts/#get-email-domain-domain-account-accountname-migrate-destinationservicename-destinationemailaddress-destinationemailaddress

**Status:** Beta version  
**IAM actions:** `emailDomain:apiovh:account/migrate/destinationEmailAddress/get`

Get a destination email account. Returns the email address and maximum size of the destination account.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountName` | path | string | yes | Name of account |
| `destinationEmailAddress` | path | string | yes | Destination account name |
| `destinationServiceName` | path | string | yes | Service name allowed as migration destination |
| `domain` | path | string | yes | Name of your domain name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.MigrationAccount | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `destinationEmailAddress` | string | read-only | Destination account name |
| `quota` | integer | read-only | Account maximum size |

```json
{
  "destinationEmailAddress": "string",
  "quota": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress/{destinationEmailAddress}" \
  -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/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress/{destinationEmailAddress}")

# 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/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress/{destinationEmailAddress}");

print_r($result);
?>
```

## Check an email account migration

`GET /1.0/email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress/{destinationEmailAddress}/checkMigrate`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/accounts/#get-email-domain-domain-account-accountname-migrate-destinationservicename-destinationemailaddress-destinationemailaddress-checkmigrate

**Status:** Beta version  
**IAM actions:** `emailDomain:apiovh:account/migrate/destinationEmailAddress/checkMigrate/get`

Check an email account migration. Returns the errors and warnings found for the migration to the destination account, and the aliases, filters and forwards found.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountName` | path | string | yes | Name of account |
| `destinationEmailAddress` | path | string | yes | Destination account name |
| `destinationServiceName` | path | string | yes | Service name allowed as migration destination |
| `domain` | path | string | yes | Name of your domain name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.MigrationCheckStruct | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `alias` | string[] |  | List of aliases |
| `error` | email.domain.MigrationCheckResultStruct[] |  | List of errors |
| `error[].code` | email.domain.MigrationCheckCodeEnum |  | Result code of check migration — one of `ACCOUNT_EMPTY`, `ACCOUNT_INPROGRESS`, `DELEGATION_EXIST`, `DOMAIN_EMPTY`, `FILTER_EXIST`, `FORWARD_EXIST`, `FORWARD_LOCAL`, `MAILINGLIST_EXIST`, `MAILINGLIST_INPROGRESS`, `MAILPROXY_BAD_INFRA`, `MAILPROXY_EMPTY`, `MAILPROXY_INPROGRESS`, … |
| `error[].details` | string |  | Details of result code |
| `filter` | string[] |  | List of filters |
| `forward` | string[] |  | List of forwards |
| `warning` | email.domain.MigrationCheckResultStruct[] |  | List of warnings |
| `warning[].code` | email.domain.MigrationCheckCodeEnum |  | Result code of check migration — one of `ACCOUNT_EMPTY`, `ACCOUNT_INPROGRESS`, `DELEGATION_EXIST`, `DOMAIN_EMPTY`, `FILTER_EXIST`, `FORWARD_EXIST`, `FORWARD_LOCAL`, `MAILINGLIST_EXIST`, `MAILINGLIST_INPROGRESS`, `MAILPROXY_BAD_INFRA`, `MAILPROXY_EMPTY`, `MAILPROXY_INPROGRESS`, … |
| `warning[].details` | string |  | Details of result code |

```json
{
  "alias": [
    "string"
  ],
  "error": [
    {
      "code": "ACCOUNT_EMPTY",
      "details": "string"
    }
  ],
  "filter": [
    "string"
  ],
  "forward": [
    "string"
  ],
  "warning": [
    {
      "code": "ACCOUNT_EMPTY",
      "details": "string"
    }
  ]
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress/{destinationEmailAddress}/checkMigrate" \
  -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/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress/{destinationEmailAddress}/checkMigrate")

# 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/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress/{destinationEmailAddress}/checkMigrate");

print_r($result);
?>
```

## Migrate an email account

`POST /1.0/email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress/{destinationEmailAddress}/migrate`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/accounts/#post-email-domain-domain-account-accountname-migrate-destinationservicename-destinationemailaddress-destinationemailaddress-migrate

**Status:** Beta version  
**IAM actions:** `emailDomain:apiovh:account/migrate/destinationEmailAddress/migrate`

Migrate an email account. Migrates the email account to the destination account and returns the task. `password` is the new password used for the migration.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountName` | path | string | yes | Name of account |
| `destinationEmailAddress` | path | string | yes | Destination account name |
| `destinationServiceName` | path | string | yes | Service name allowed as migration destination |
| `domain` | path | string | yes | Name of your domain name |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `password` | string (password) | yes | New password used for migration |

```json
{
  "password": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.TaskPop | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | domain.DomainPopActionEnum | read-only | Action of task — one of `addAccount`, `changeAccount`, `changePassword`, `deleteAccount`, `internalMigration`, `migration`, `temporaryTask`, `unknown` |
| `date` | string (date-time) | read-only | Creation date of task |
| `domain` | string | read-only | Domain name of task |
| `id` | integer | read-only | Id of task |
| `name` | string | read-only | Account name of task |

```json
{
  "action": "addAccount",
  "date": "2024-01-01T12:00:00Z",
  "domain": "string",
  "id": 0,
  "name": "string"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress/{destinationEmailAddress}/migrate" \
  -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: password
result = client.post("/email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress/{destinationEmailAddress}/migrate",
	password = None, # New password used for migration (type: password)
)

# 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: password
$result = $ovh->post("/email/domain/{domain}/account/{accountName}/migrate/{destinationServiceName}/destinationEmailAddress/{destinationEmailAddress}/migrate", array(
	password => null, // New password used for migration (type: password)
));

print_r($result);
?>
```

## Refresh email account usage

`POST /1.0/email/domain/{domain}/account/{accountName}/updateUsage`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/accounts/#post-email-domain-domain-account-accountname-updateusage

**Status:** Stable production version  
**IAM actions:** `emailDomain:apiovh:account/updateUsage`

Refresh email account usage. Asks for the figures returned by `usage` to be recomputed; they are updated asynchronously.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountName` | path | string | yes | Name of account |
| `domain` | path | string | yes | Name of your domain name |

### Responses

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

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/domain/{domain}/account/{accountName}/updateUsage" \
  -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.post("/email/domain/{domain}/account/{accountName}/updateUsage")

# 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->post("/email/domain/{domain}/account/{accountName}/updateUsage");

print_r($result);
?>
```

## Get email account usage

`GET /1.0/email/domain/{domain}/account/{accountName}/usage`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/accounts/#get-email-domain-domain-account-accountname-usage

**Status:** Stable production version  
**IAM actions:** `emailDomain:apiovh:account/usage/get`

Get email account usage. Returns the number of emails, the maximum size in bytes of the mailbox (`quota`) and the date of the measure.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountName` | path | string | yes | Name of account |
| `domain` | path | string | yes | Name of your domain name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | domain.DomainUsageAccountStruct | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `date` | string (date-time) |  | Timestamp |
| `emailCount` | integer |  | Number of message in mailbox |
| `quota` | integer |  | Size of mailbox (bytes) |

```json
{
  "date": "2024-01-01T12:00:00Z",
  "emailCount": 0,
  "quota": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/domain/{domain}/account/{accountName}/usage" \
  -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/domain/{domain}/account/{accountName}/usage")

# 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/domain/{domain}/account/{accountName}/usage");

print_r($result);
?>
```
