# Web Cloud › Email and Collaborative Solutions › Zimbra › Platforms API

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

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

Page: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/zimbra/platforms/

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

## Operations

- `GET /zimbra/platform` — List platforms
- `GET /zimbra/platform/{platformId}` — Get a platform
- `PUT /zimbra/platform/{platformId}` — Update a platform
- `POST /zimbra/platform/{platformId}/refreshQuotaUsage` — Refresh quota usage

## List platforms

`GET /v2/zimbra/platform`

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

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

Returns the platforms of the account with their current state. Filter them by `projectId`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `iamTags` | query | object |  | Filter resources on IAM tags |
| `projectId` | query | string (uuid) |  | Identifier of the project |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | zimbra.PlatformResponseWithIAM[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Checksum hash in MD5 representation |
| `currentState` | zimbra.PlatformCurrentState | read-only | Object representing platform |
| `currentState.accountsStatistics` | zimbra.OfferStatistics[] | read-only | Statistics of accounts on the platform |
| `currentState.accountsStatistics[].availableAccountsCount` | integer | read-only | Total number of accounts on this offer that can be configured |
| `currentState.accountsStatistics[].configuredAccountsCount` | integer | read-only | Number of accounts on the offer that are configured |
| `currentState.accountsStatistics[].offer` | zimbra.OfferEnum | read-only | Commercial name of the offer — one of `PRO`, `STARTER` |
| `currentState.clusterHostname` | string | read-only | A zimbra cluster hostname where all customer mailbox are placed |
| `currentState.description` | string | read-only | Description of the platform |
| `currentState.name` | string | read-only | Name of the platform |
| `currentState.numberOfOrganizations` | integer | read-only | Total number of created organizations in the platform |
| `currentState.quota` | number | read-only | Maximum storage capacity per account allowed on the platform |
| `currentTasks` | common.CurrentTask[] | read-only | An array containing tasks responses pending on resource extends AsyncResourceBase object |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `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 |
| `id` | string (uuid) | read-only | Resource identifier in UUID representation |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Current resource status — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | zimbra.PlatformPutTargetSpec | read-only | Object representing platform |
| `targetSpec.description` | string |  | Description of the platform |
| `targetSpec.name` | string |  | Name of the platform |

```json
[
  {
    "checksum": "string",
    "currentState": {
      "accountsStatistics": [
        {
          "availableAccountsCount": 0,
          "configuredAccountsCount": 0,
          "offer": "PRO"
        }
      ],
      "clusterHostname": "string",
      "description": "string",
      "name": "string",
      "numberOfOrganizations": 0,
      "quota": 0
    },
    "currentTasks": [
      {
        "errors": [
          {
            "message": "string"
          }
        ],
        "id": "00000000-0000-0000-0000-000000000000",
        "link": "string",
        "status": "ERROR",
        "type": "string"
      }
    ],
    "iam": {
      "displayName": "string",
      "id": "00000000-0000-0000-0000-000000000000",
      "state": "EXPIRED",
      "tags": {
        "key": "string"
      },
      "urn": "string"
    },
    "id": "00000000-0000-0000-0000-000000000000",
    "resourceStatus": "CREATING",
    "targetSpec": {
      "description": "string",
      "name": "string"
    }
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/zimbra/platform" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

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

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

result = client.get("/v2/zimbra/platform")

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

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

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

$result = $ovh->get("/v2/zimbra/platform");

print_r($result);
?>
```

## Get a platform

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

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

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

Returns the name and description of the platform, its number of organizations, its storage quota per account and its account statistics per offer.

### Parameters

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

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Checksum hash in MD5 representation |
| `currentState` | zimbra.PlatformCurrentState | read-only | Object representing platform |
| `currentState.accountsStatistics` | zimbra.OfferStatistics[] | read-only | Statistics of accounts on the platform |
| `currentState.accountsStatistics[].availableAccountsCount` | integer | read-only | Total number of accounts on this offer that can be configured |
| `currentState.accountsStatistics[].configuredAccountsCount` | integer | read-only | Number of accounts on the offer that are configured |
| `currentState.accountsStatistics[].offer` | zimbra.OfferEnum | read-only | Commercial name of the offer — one of `PRO`, `STARTER` |
| `currentState.clusterHostname` | string | read-only | A zimbra cluster hostname where all customer mailbox are placed |
| `currentState.description` | string | read-only | Description of the platform |
| `currentState.name` | string | read-only | Name of the platform |
| `currentState.numberOfOrganizations` | integer | read-only | Total number of created organizations in the platform |
| `currentState.quota` | number | read-only | Maximum storage capacity per account allowed on the platform |
| `currentTasks` | common.CurrentTask[] | read-only | An array containing tasks responses pending on resource extends AsyncResourceBase object |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `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 |
| `id` | string (uuid) | read-only | Resource identifier in UUID representation |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Current resource status — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | zimbra.PlatformPutTargetSpec | read-only | Object representing platform |
| `targetSpec.description` | string |  | Description of the platform |
| `targetSpec.name` | string |  | Name of the platform |

```json
{
  "checksum": "string",
  "currentState": {
    "accountsStatistics": [
      {
        "availableAccountsCount": 0,
        "configuredAccountsCount": 0,
        "offer": "PRO"
      }
    ],
    "clusterHostname": "string",
    "description": "string",
    "name": "string",
    "numberOfOrganizations": 0,
    "quota": 0
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "iam": {
    "displayName": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "state": "EXPIRED",
    "tags": {
      "key": "string"
    },
    "urn": "string"
  },
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "description": "string",
    "name": "string"
  }
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/zimbra/platform/{platformId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

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

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

result = client.get("/v2/zimbra/platform/{platformId}")

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

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

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

$result = $ovh->get("/v2/zimbra/platform/{platformId}");

print_r($result);
?>
```

## Update a platform

`PUT /v2/zimbra/platform/{platformId}`

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

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

Updates the name or description of the platform. When set, `checksum` must match the current checksum of the platform, otherwise the update is rejected.

### Parameters

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

### Request body (required)

Type: `zimbra.PlatformPutPayload`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string |  | Known checksum of the resource, allowing to prevent unwanted side effects |
| `targetSpec` | zimbra.PlatformPutTargetSpec | yes | Target platform specification |
| `targetSpec.description` | string |  | Description of the platform |
| `targetSpec.name` | string |  | Name of the platform |

```json
{
  "checksum": "string",
  "targetSpec": {
    "description": "string",
    "name": "string"
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | zimbra.PlatformResponse | successful operation |
| 404 | object | Error 404 response |
| 409 | object | Error 409 response |
| 412 | object | Error 412 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `checksum` | string | read-only | Checksum hash in MD5 representation |
| `currentState` | zimbra.PlatformCurrentState | read-only | Object representing platform |
| `currentState.accountsStatistics` | zimbra.OfferStatistics[] | read-only | Statistics of accounts on the platform |
| `currentState.accountsStatistics[].availableAccountsCount` | integer | read-only | Total number of accounts on this offer that can be configured |
| `currentState.accountsStatistics[].configuredAccountsCount` | integer | read-only | Number of accounts on the offer that are configured |
| `currentState.accountsStatistics[].offer` | zimbra.OfferEnum | read-only | Commercial name of the offer — one of `PRO`, `STARTER` |
| `currentState.clusterHostname` | string | read-only | A zimbra cluster hostname where all customer mailbox are placed |
| `currentState.description` | string | read-only | Description of the platform |
| `currentState.name` | string | read-only | Name of the platform |
| `currentState.numberOfOrganizations` | integer | read-only | Total number of created organizations in the platform |
| `currentState.quota` | number | read-only | Maximum storage capacity per account allowed on the platform |
| `currentTasks` | common.CurrentTask[] | read-only | An array containing tasks responses pending on resource extends AsyncResourceBase object |
| `currentTasks[].errors` | common.TaskError[] | read-only | Errors that occurred on the task |
| `currentTasks[].errors[].message` | string | read-only | Error description |
| `currentTasks[].id` | string (uuid) | read-only | Identifier of the current task |
| `currentTasks[].link` | string | read-only | Link to the task details |
| `currentTasks[].status` | common.CurrentTaskStatusEnum | read-only | Current global status of the current task — one of `ERROR`, `PENDING`, `RUNNING`, `SCHEDULED`, `WAITING_USER_INPUT` |
| `currentTasks[].type` | string | read-only | Type of the current task |
| `id` | string (uuid) | read-only | Resource identifier in UUID representation |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Current resource status — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `targetSpec` | zimbra.PlatformPutTargetSpec | read-only | Object representing platform |
| `targetSpec.description` | string |  | Description of the platform |
| `targetSpec.name` | string |  | Name of the platform |

```json
{
  "checksum": "string",
  "currentState": {
    "accountsStatistics": [
      {
        "availableAccountsCount": 0,
        "configuredAccountsCount": 0,
        "offer": "PRO"
      }
    ],
    "clusterHostname": "string",
    "description": "string",
    "name": "string",
    "numberOfOrganizations": 0,
    "quota": 0
  },
  "currentTasks": [
    {
      "errors": [
        {
          "message": "string"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "link": "string",
      "status": "ERROR",
      "type": "string"
    }
  ],
  "id": "00000000-0000-0000-0000-000000000000",
  "resourceStatus": "CREATING",
  "targetSpec": {
    "description": "string",
    "name": "string"
  }
}
```

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/v2/zimbra/platform/{platformId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

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

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

# Request body type: zimbra.PlatformPutPayload
result = client.put("/v2/zimbra/platform/{platformId}",
	checksum = None, # Known checksum of the resource, allowing to prevent unwanted side effects (type: string)
	targetSpec = None, # Target platform specification (type: zimbra.PlatformPutTargetSpec)
)

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

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

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

// Request body type: zimbra.PlatformPutPayload
$result = $ovh->put("/v2/zimbra/platform/{platformId}", array(
	checksum => null, // Known checksum of the resource, allowing to prevent unwanted side effects (type: string)
	targetSpec => null, // Target platform specification (type: zimbra.PlatformPutTargetSpec)
));

print_r($result);
?>
```

## Refresh quota usage

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

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

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

Recomputes the quota usage (`quota.used` and `quotaRefreshedAt`) of every email account of the platform. The refresh runs asynchronously.

### Parameters

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

### Responses

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

### Example

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

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

print_r($result);
?>
```
