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

> 6 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/accounts/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/web-cloud/email-and-collaborative-solutions/mx-plan/zimbra-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/zimbra-platform/accounts.json?format=openapi3

## Operations

- `GET /email/mxplan/{service}/account` — List email accounts
- `GET /email/mxplan/{service}/account/{email}` — Get an email account
- `DELETE /email/mxplan/{service}/account/{email}` — Delete an email account
- `PUT /email/mxplan/{service}/account/{email}` — Update an email account
- `GET /email/mxplan/{service}/account/{email}/capabilities` — Get email account capabilities
- `POST /email/mxplan/{service}/account/{email}/changePassword` — Change an email account password

## List email accounts

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

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

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

List email accounts. Returns the email addresses of the email accounts of the service. Filter them by `primaryEmailAddress` or `id`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | query | integer |  | Filter the value of id property (like) |
| `primaryEmailAddress` | query | string |  | Filter the value of primaryEmailAddress property (like) |
| `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" \
  -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")

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

print_r($result);
?>
```

## Get an email account

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

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

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

Get an email account. Returns the login, names, domain, state, quota and usage of the email account, its renewal and expiration settings, and its spam and virus configuration.

### 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 | email.mxplan.Account | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `SAMAccountName` | string | read-only | SAM account name |
| `configured` | boolean | read-only | Indicates if the account is configured |
| `creationDate` | string (date-time) | read-only | Creation date |
| `currentUsage` | integer | read-only | Mailbox usage |
| `deleteAtExpiration` | boolean |  | delete at expiration |
| `displayName` | string |  | Account display name |
| `domain` | string |  | Email domain |
| `expirationDate` | string (date-time) | read-only | expiration date |
| `expirationOutlookDate` | string (date-time) | read-only | expiration date |
| `firstName` | string |  | Account first name |
| `hiddenFromGAL` | boolean |  | Hide account in Global Address List |
| `id` | integer | read-only | Account id |
| `initial` | string |  | Account initials |
| `lastLogoffDate` | string (date-time) | read-only | Last logoff |
| `lastLogonDate` | string (date-time) | read-only | Last logon |
| `lastName` | string |  | Account last name |
| `lastUpdateDate` | string (date-time) | read-only | Last update |
| `login` | string |  | Account login |
| `mailingFilter` | email.pro.MailingFilterEnum[] |  | Enable or disable anti-virus and anti-spam |
| `passwordLastUpdate` | string (date-time) | read-only | Time of account's password last update |
| `primaryEmailAddress` | string | read-only | Default email for this mailbox |
| `quota` | number |  | Account maximum size |
| `renewPeriod` | email.pro.renewPeriodEnum |  | change the renew period — one of `monthly`, `yearly` |
| `spamAndVirusConfiguration` | email.pro.spamAndVirusConfiguration |  | Spam and Antivirus configuration |
| `spamAndVirusConfiguration.checkDKIM` | boolean |  | Check DKIM of message |
| `spamAndVirusConfiguration.checkSPF` | boolean |  | Check SPF of message |
| `spamAndVirusConfiguration.deleteSpam` | boolean |  | If message is a spam delete it |
| `spamAndVirusConfiguration.deleteVirus` | boolean |  | If message is a virus delete it |
| `spamAndVirusConfiguration.putInJunk` | boolean |  | If message is a spam or virus put in junk. Overridden by deleteSpam or deleteVirus |
| `spamAndVirusConfiguration.tagSpam` | boolean |  | If message is a spam change its subject |
| `spamAndVirusConfiguration.tagVirus` | boolean |  | If message is a virus change its subject |
| `spamDetected` | boolean | read-only | Account was sending spam |
| `spamTicketNumber` | integer | read-only | Ticket number of spam detection |
| `state` | email.pro.ObjectStateEnum | read-only | Account state — one of `creating`, `deleting`, `ok`, `reopening`, `suspended`, `suspending`, `unknown` |
| `taskPendingId` | integer | read-only | Pending tasks for this account |

```json
{
  "SAMAccountName": "string",
  "configured": true,
  "creationDate": "2024-01-01T12:00:00Z",
  "currentUsage": 0,
  "deleteAtExpiration": true,
  "displayName": "string",
  "domain": "string",
  "expirationDate": "2024-01-01T12:00:00Z",
  "expirationOutlookDate": "2024-01-01T12:00:00Z",
  "firstName": "string",
  "hiddenFromGAL": true,
  "id": 0,
  "initial": "string",
  "lastLogoffDate": "2024-01-01T12:00:00Z",
  "lastLogonDate": "2024-01-01T12:00:00Z",
  "lastName": "string",
  "lastUpdateDate": "2024-01-01T12:00:00Z",
  "login": "string",
  "mailingFilter": [
    "vaderetro"
  ],
  "passwordLastUpdate": "2024-01-01T12:00:00Z",
  "primaryEmailAddress": "string",
  "quota": 0,
  "renewPeriod": "monthly",
  "spamAndVirusConfiguration": {
    "checkDKIM": true,
    "checkSPF": true,
    "deleteSpam": true,
    "deleteVirus": true,
    "putInJunk": true,
    "tagSpam": true,
    "tagVirus": true
  },
  "spamDetected": true,
  "spamTicketNumber": 0,
  "state": "creating",
  "taskPendingId": 0
}
```

### Example

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

# 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}");

print_r($result);
?>
```

## Delete an email account

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

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

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

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

### 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 | 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}" \
  -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}")

# 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}");

print_r($result);
?>
```

## Update an email account

`PUT /1.0/email/mxplan/{service}/account/{email}`

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

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

Update an email account. Updates the login, names, domain, quota, renewal period, deletion at expiration, Global Address List visibility and spam and virus configuration of the email account.

### 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: `email.mxplan.Account`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `SAMAccountName` | string | read-only | SAM account name |
| `configured` | boolean | read-only | Indicates if the account is configured |
| `creationDate` | string (date-time) | read-only | Creation date |
| `currentUsage` | integer | read-only | Mailbox usage |
| `deleteAtExpiration` | boolean |  | delete at expiration |
| `displayName` | string |  | Account display name |
| `domain` | string |  | Email domain |
| `expirationDate` | string (date-time) | read-only | expiration date |
| `expirationOutlookDate` | string (date-time) | read-only | expiration date |
| `firstName` | string |  | Account first name |
| `hiddenFromGAL` | boolean |  | Hide account in Global Address List |
| `id` | integer | read-only | Account id |
| `initial` | string |  | Account initials |
| `lastLogoffDate` | string (date-time) | read-only | Last logoff |
| `lastLogonDate` | string (date-time) | read-only | Last logon |
| `lastName` | string |  | Account last name |
| `lastUpdateDate` | string (date-time) | read-only | Last update |
| `login` | string |  | Account login |
| `mailingFilter` | email.pro.MailingFilterEnum[] |  | Enable or disable anti-virus and anti-spam |
| `passwordLastUpdate` | string (date-time) | read-only | Time of account's password last update |
| `primaryEmailAddress` | string | read-only | Default email for this mailbox |
| `quota` | number |  | Account maximum size |
| `renewPeriod` | email.pro.renewPeriodEnum |  | change the renew period — one of `monthly`, `yearly` |
| `spamAndVirusConfiguration` | email.pro.spamAndVirusConfiguration |  | Spam and Antivirus configuration |
| `spamAndVirusConfiguration.checkDKIM` | boolean |  | Check DKIM of message |
| `spamAndVirusConfiguration.checkSPF` | boolean |  | Check SPF of message |
| `spamAndVirusConfiguration.deleteSpam` | boolean |  | If message is a spam delete it |
| `spamAndVirusConfiguration.deleteVirus` | boolean |  | If message is a virus delete it |
| `spamAndVirusConfiguration.putInJunk` | boolean |  | If message is a spam or virus put in junk. Overridden by deleteSpam or deleteVirus |
| `spamAndVirusConfiguration.tagSpam` | boolean |  | If message is a spam change its subject |
| `spamAndVirusConfiguration.tagVirus` | boolean |  | If message is a virus change its subject |
| `spamDetected` | boolean | read-only | Account was sending spam |
| `spamTicketNumber` | integer | read-only | Ticket number of spam detection |
| `state` | email.pro.ObjectStateEnum | read-only | Account state — one of `creating`, `deleting`, `ok`, `reopening`, `suspended`, `suspending`, `unknown` |
| `taskPendingId` | integer | read-only | Pending tasks for this account |

```json
{
  "deleteAtExpiration": true,
  "displayName": "string",
  "domain": "string",
  "firstName": "string",
  "hiddenFromGAL": true,
  "initial": "string",
  "lastName": "string",
  "login": "string",
  "mailingFilter": [
    "vaderetro"
  ],
  "quota": 0,
  "renewPeriod": "monthly",
  "spamAndVirusConfiguration": {
    "checkDKIM": true,
    "checkSPF": true,
    "deleteSpam": true,
    "deleteVirus": true,
    "putInJunk": true,
    "tagSpam": true,
    "tagVirus": true
  }
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/email/mxplan/{service}/account/{email}" \
  -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.mxplan.Account
result = client.put("/email/mxplan/{service}/account/{email}",
	deleteAtExpiration = None, # delete at expiration (type: boolean, nullable)
	displayName = None, # Account display name (type: string, nullable)
	domain = None, # Email domain (type: string)
	firstName = None, # Account first name (type: string, nullable)
	hiddenFromGAL = None, # Hide account in Global Address List (type: boolean)
	initial = None, # Account initials (type: string, nullable)
	lastName = None, # Account last name (type: string, nullable)
	login = None, # Account login (type: string)
	mailingFilter = None, # Enable or disable anti-virus and anti-spam (type: array, nullable)
	quota = None, # Account maximum size (type: number)
	renewPeriod = None, # change the renew period (type: email.pro.renewPeriodEnum, nullable)
	spamAndVirusConfiguration = None, # Spam and Antivirus configuration (type: email.pro.spamAndVirusConfiguration)
)

# 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.mxplan.Account
$result = $ovh->put("/email/mxplan/{service}/account/{email}", array(
	deleteAtExpiration => null, // delete at expiration (type: boolean, nullable)
	displayName => null, // Account display name (type: string, nullable)
	domain => null, // Email domain (type: string)
	firstName => null, // Account first name (type: string, nullable)
	hiddenFromGAL => null, // Hide account in Global Address List (type: boolean)
	initial => null, // Account initials (type: string, nullable)
	lastName => null, // Account last name (type: string, nullable)
	login => null, // Account login (type: string)
	mailingFilter => null, // Enable or disable anti-virus and anti-spam (type: array, nullable)
	quota => null, // Account maximum size (type: number)
	renewPeriod => null, // change the renew period (type: email.pro.renewPeriodEnum, nullable)
	spamAndVirusConfiguration => null, // Spam and Antivirus configuration (type: email.pro.spamAndVirusConfiguration)
));

print_r($result);
?>
```

## Get email account capabilities

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

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

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

Get email account capabilities. Returns the quotas that can be set on the email account. No value means that any quota is allowed.

### 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 | email.mxplan.accountCapabilities | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `quotas` | number[] |  | List of allowed quotas (no constraint if null) |

```json
{
  "quotas": [
    0
  ]
}
```

### Example

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

# 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}/capabilities");

print_r($result);
?>
```

## Change an email account password

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

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

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

Change an email account password. Sets the new `password` of the email account and returns the task that applies it.

### 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 |
| --- | --- | --- | --- |
| `password` | string (password) | yes | new password |

```json
{
  "password": "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}/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/mxplan/{service}/account/{email}/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/mxplan/{service}/account/{email}/changePassword", array(
	password => null, // new password (type: password)
));

print_r($result);
?>
```
