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

> 5 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/services/

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

## Operations

- `GET /email/mxplan` — List MX Plan services
- `GET /email/mxplan/{service}` — Get the MX Plan service
- `PUT /email/mxplan/{service}` — Update the MX Plan service
- `GET /email/mxplan/{service}/server` — Get the server
- `POST /email/mxplan/{service}/updateFlagsOnAllAccounts` — Update spam and virus flags

## List MX Plan services

`GET /1.0/email/mxplan`

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

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

List MX Plan services. Returns the names of the MX Plan services of the account. Filter them by IAM tags with `iamTags`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `iamTags` | query | object |  | Filter resources on IAM tags |

### Responses

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

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

### Example

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

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

print_r($result);
?>
```

## Get the MX Plan service

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

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

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

Get the MX Plan service. Returns the state, offer, hostname and web interface URL of the service, its message size limits, its password and lockout policy, and its spam and virus configuration.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `service` | path | string | yes | The internal name of your mxplan organization |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `complexityEnabled` | boolean |  | enable policy for strong and secure passwords |
| `displayName` | string |  | service displayName |
| `domain` | string | read-only | Domain name of your service |
| `hostname` | string | read-only | Hostname of your service |
| `iam` | iam.ResourceMetadata | read-only | IAM resource metadata |
| `iam.displayName` | string | read-only | Resource display name |
| `iam.id` | string (uuid) | read-only | Unique identifier of the resource |
| `iam.state` | iam.ResourceMetadata.StateEnum | read-only | Resource state — one of `EXPIRED`, `IN_CREATION`, `OK`, `SUSPENDED` |
| `iam.tags` | object | read-only | Resource tags. Tags that were internally computed are prefixed with ovh: |
| `iam.urn` | string | read-only | Unique resource name used in policies |
| `isZimbra` | boolean | read-only | Service use Zimbra as backend |
| `lastUpdateDate` | string (date-time) | read-only | Update date |
| `lockoutDuration` | integer |  | number of minutes account will remain locked if it occurs |
| `lockoutObservationWindow` | integer |  | number of minutes that must elapse after a failed logon to reset lockout trigger |
| `lockoutThreshold` | integer |  | number of attempts before account to be locked |
| `maxPasswordAge` | integer |  | maximum number of days that account's password is valid before expiration |
| `maxReceiveSize` | integer |  | Maximum message size that You can receive in MB |
| `maxSendSize` | integer |  | Maximum message size that You can send in MB |
| `minPasswordAge` | integer |  | minimum number of days before able to change account's password |
| `minPasswordLength` | integer |  | minimum number of characters password must contain |
| `offer` | email.mxplan.ServiceOfferEnum | read-only | Type of your offer — one of `MXPLAN` |
| `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 |
| `state` | email.pro.ServiceStateEnum | read-only | State of your service — one of `creating`, `deleting`, `inMaintenance`, `ok`, `reopening`, `suspended`, `suspending` |
| `taskPendingId` | integer | read-only | Task pending id |
| `webUrl` | string | read-only | URL for web interface |

```json
{
  "complexityEnabled": true,
  "displayName": "string",
  "domain": "string",
  "hostname": "string",
  "iam": {
    "displayName": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "state": "EXPIRED",
    "tags": {
      "key": "string"
    },
    "urn": "string"
  },
  "isZimbra": true,
  "lastUpdateDate": "2024-01-01T12:00:00Z",
  "lockoutDuration": 0,
  "lockoutObservationWindow": 0,
  "lockoutThreshold": 0,
  "maxPasswordAge": 0,
  "maxReceiveSize": 0,
  "maxSendSize": 0,
  "minPasswordAge": 0,
  "minPasswordLength": 0,
  "offer": "MXPLAN",
  "spamAndVirusConfiguration": {
    "checkDKIM": true,
    "checkSPF": true,
    "deleteSpam": true,
    "deleteVirus": true,
    "putInJunk": true,
    "tagSpam": true,
    "tagVirus": true
  },
  "state": "creating",
  "taskPendingId": 0,
  "webUrl": "string"
}
```

### Example

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

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

print_r($result);
?>
```

## Update the MX Plan service

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

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

**Status:** Stable production version  
**IAM actions:** `emailMxplan:apiovh:put`

Update the MX Plan service. Updates the display name, message size limits, password and lockout policy, and spam and virus configuration of the service.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `service` | path | string | yes | The internal name of your mxplan organization |

### Request body (required)

Type: `email.mxplan.Service`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `complexityEnabled` | boolean |  | enable policy for strong and secure passwords |
| `displayName` | string |  | service displayName |
| `domain` | string | read-only | Domain name of your service |
| `hostname` | string | read-only | Hostname of your service |
| `isZimbra` | boolean | read-only | Service use Zimbra as backend |
| `lastUpdateDate` | string (date-time) | read-only | Update date |
| `lockoutDuration` | integer |  | number of minutes account will remain locked if it occurs |
| `lockoutObservationWindow` | integer |  | number of minutes that must elapse after a failed logon to reset lockout trigger |
| `lockoutThreshold` | integer |  | number of attempts before account to be locked |
| `maxPasswordAge` | integer |  | maximum number of days that account's password is valid before expiration |
| `maxReceiveSize` | integer |  | Maximum message size that You can receive in MB |
| `maxSendSize` | integer |  | Maximum message size that You can send in MB |
| `minPasswordAge` | integer |  | minimum number of days before able to change account's password |
| `minPasswordLength` | integer |  | minimum number of characters password must contain |
| `offer` | email.mxplan.ServiceOfferEnum | read-only | Type of your offer — one of `MXPLAN` |
| `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 |
| `state` | email.pro.ServiceStateEnum | read-only | State of your service — one of `creating`, `deleting`, `inMaintenance`, `ok`, `reopening`, `suspended`, `suspending` |
| `taskPendingId` | integer | read-only | Task pending id |
| `webUrl` | string | read-only | URL for web interface |

```json
{
  "complexityEnabled": true,
  "displayName": "string",
  "lockoutDuration": 0,
  "lockoutObservationWindow": 0,
  "lockoutThreshold": 0,
  "maxPasswordAge": 0,
  "maxReceiveSize": 0,
  "maxSendSize": 0,
  "minPasswordAge": 0,
  "minPasswordLength": 0,
  "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}" \
  -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.Service
result = client.put("/email/mxplan/{service}",
	complexityEnabled = None, # enable policy for strong and secure passwords (type: boolean)
	displayName = None, # service displayName (type: string, nullable)
	lockoutDuration = None, # number of minutes account will remain locked if it occurs (type: integer)
	lockoutObservationWindow = None, # number of minutes that must elapse after a failed logon to reset lockout trigger (type: integer)
	lockoutThreshold = None, # number of attempts before account to be locked (type: integer, nullable)
	maxPasswordAge = None, # maximum number of days that account's password is valid before expiration (type: integer, nullable)
	maxReceiveSize = None, # Maximum message size that You can receive in MB (type: integer)
	maxSendSize = None, # Maximum message size that You can send in MB (type: integer)
	minPasswordAge = None, # minimum number of days before able to change account's password (type: integer, nullable)
	minPasswordLength = None, # minimum number of characters password must contain (type: integer, 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.Service
$result = $ovh->put("/email/mxplan/{service}", array(
	complexityEnabled => null, // enable policy for strong and secure passwords (type: boolean)
	displayName => null, // service displayName (type: string, nullable)
	lockoutDuration => null, // number of minutes account will remain locked if it occurs (type: integer)
	lockoutObservationWindow => null, // number of minutes that must elapse after a failed logon to reset lockout trigger (type: integer)
	lockoutThreshold => null, // number of attempts before account to be locked (type: integer, nullable)
	maxPasswordAge => null, // maximum number of days that account's password is valid before expiration (type: integer, nullable)
	maxReceiveSize => null, // Maximum message size that You can receive in MB (type: integer)
	maxSendSize => null, // Maximum message size that You can send in MB (type: integer)
	minPasswordAge => null, // minimum number of days before able to change account's password (type: integer, nullable)
	minPasswordLength => null, // minimum number of characters password must contain (type: integer, nullable)
	spamAndVirusConfiguration => null, // Spam and Antivirus configuration (type: email.pro.spamAndVirusConfiguration)
));

print_r($result);
?>
```

## Get the server

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

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

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

Get the server. Returns the state, IPv4 and IPv6 addresses, version and disk usage of the server, and whether its A, AAAA and PTR DNS records are valid.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `service` | path | string | yes | The internal name of your mxplan organization |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `currentDiskUsage` | integer | read-only | Current disk usage in MB |
| `diskSize` | integer | read-only | Total disk size in MB |
| `ip` | ipv4 | read-only | ipV4 |
| `ipV6` | ipv6 | read-only | ipV6 |
| `isAValid` | boolean | read-only | If true your dns A record is valid |
| `isAaaaValid` | boolean | read-only | If true your dns AAAA record is valid |
| `isPtrV6Valid` | boolean | read-only | If true your dns ptrV6 record is valid |
| `isPtrValid` | boolean | read-only | If true your dns ptr record is valid |
| `state` | email.pro.ServerStateEnum | read-only | Server state — one of `configurationPending`, `notConfigured`, `ok` |
| `taskPendingId` | integer | read-only | Task pending id |
| `version` | integer | read-only | Server version |

```json
{
  "currentDiskUsage": 0,
  "diskSize": 0,
  "ip": "192.0.2.0",
  "ipV6": "2001:41d0:1:1994::1",
  "isAValid": true,
  "isAaaaValid": true,
  "isPtrV6Valid": true,
  "isPtrValid": true,
  "state": "configurationPending",
  "taskPendingId": 0,
  "version": 0
}
```

### Example

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

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

print_r($result);
?>
```

## Update spam and virus flags

`POST /1.0/email/mxplan/{service}/updateFlagsOnAllAccounts`

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

**Status:** Stable production version  
**IAM actions:** `emailMxplan:apiovh:updateFlagsOnAllAccounts`

Update spam and virus flags. Updates the spam and virus flags of all the active email accounts of the service.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `service` | path | string | yes | The internal name of your mxplan organization |

### Responses

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

### Example

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

# 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/mxplan/{service}/updateFlagsOnAllAccounts");

print_r($result);
?>
```
