# Web Cloud › Email and Collaborative Solutions › Microsoft Exchange › Private Exchange › Email 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

> 50 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/microsoft-exchange/private-exchange/email-accounts/

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

## Operations

- `GET /email/exchange/{organizationName}/service/{exchangeService}/account` — List email accounts
- `GET /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}` — Get an email account
- `POST /email/exchange/{organizationName}/service/{exchangeService}/account` — Create an email account
- `DELETE /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}` — Delete an email account
- `PUT /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}` — Update an email account
- `GET /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/archive` — Get the archive mailbox
- `POST /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/archive` — Create an archive mailbox
- `DELETE /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/archive` — Delete the archive mailbox
- `PUT /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/archive` — Update the archive mailbox quota
- `POST /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/changePassword` — Change an email account password
- `GET /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/export` — Get the PST export
- `POST /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/export` — Request a PST export
- `DELETE /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/export` — Delete the PST export
- `GET /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/exportURL` — Get the PST export URL
- `POST /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/exportURL` — Generate a PST export URL
- `GET /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/outlookURL` — Get the Outlook download URL
- `POST /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/outlookURL` — Generate an Outlook download URL
- `GET /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/protocol` — Get the account protocols
- `PUT /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/protocol` — Update the account protocols
- `POST /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/terminate` — Terminate an email account at expiration
- `GET /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias` — List account aliases
- `GET /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias/{alias}` — Get an account alias
- `POST /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias` — Create an account alias
- `DELETE /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias/{alias}` — Delete an account alias
- `GET /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/fullAccess` — List full access permissions
- `GET /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/fullAccess/{allowedAccountId}` — Get a full access permission
- `POST /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/fullAccess` — Add a full access permission
- `DELETE /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/fullAccess/{allowedAccountId}` — Remove a full access permission
- `GET /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendAs` — List send as permissions
- `GET /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendAs/{allowedAccountId}` — Get a send as permission
- `POST /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendAs` — Add a send as permission
- `DELETE /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendAs/{allowedAccountId}` — Remove a send as permission
- `GET /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendOnBehalfTo` — List send on behalf permissions
- `GET /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendOnBehalfTo/{allowedAccountId}` — Get a send on behalf permission
- `POST /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendOnBehalfTo` — Add a send on behalf permission
- `DELETE /email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendOnBehalfTo/{allowedAccountId}` — Remove a send on behalf permission
- `GET /msServices/{serviceName}/account` — List Active Directory accounts
- `GET /msServices/{serviceName}/account/{userPrincipalName}` — Get an Active Directory account
- `PUT /msServices/{serviceName}/account/{userPrincipalName}` — Update an Active Directory account
- `POST /msServices/{serviceName}/account/{userPrincipalName}/changePassword` — Change the Active Directory password
- `GET /msServices/{serviceName}/account/{userPrincipalName}/exchange` — Get an account mailbox
- `PUT /msServices/{serviceName}/account/{userPrincipalName}/exchange` — Update an account mailbox
- `GET /msServices/{serviceName}/account/{userPrincipalName}/mfa` — Get the account MFA
- `POST /msServices/{serviceName}/account/{userPrincipalName}/mfa` — Create the account MFA
- `DELETE /msServices/{serviceName}/account/{userPrincipalName}/mfa` — Delete the account MFA
- `POST /msServices/{serviceName}/account/{userPrincipalName}/mfa/disable` — Disable the account MFA
- `POST /msServices/{serviceName}/account/{userPrincipalName}/mfa/enable` — Enable the account MFA
- `POST /msServices/{serviceName}/account/{userPrincipalName}/mfa/reset` — Reset the account MFA
- `POST /msServices/{serviceName}/createMfaOnAllUsers` — Create MFA on all accounts
- `POST /msServices/{serviceName}/removeMfaOnAllUsers` — Remove MFA from all accounts

## List email accounts

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/account`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#get-email-exchange-organizationname-service-exchangeservice-account

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

List email accounts. Returns the primary email addresses of the email accounts. Filter them by `primaryEmailAddress`, `id`, `accountLicense` or `company`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountLicense` | query | email.exchange.OvhLicenceEnum |  | Filter the value of accountLicense property (=) — one of `basic`, `enterprise`, `standard` |
| `company` | query | string |  | Filter the value of company property (like) |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `id` | query | integer |  | Filter the value of id property (like) |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | query | string |  | Filter the value of primaryEmailAddress property (like) |

### Responses

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

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

### Example

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

print_r($result);
?>
```

## Get an email account

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#get-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress

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

Get an email account. Returns the login, names, license, quota, usage, state, spam settings, forwarding, litigation hold and contact details of the email account.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `SAMAccountName` | string | read-only | SAM account name |
| `accountLicense` | email.exchange.OvhLicenceEnum |  | Exchange account type — one of `basic`, `enterprise`, `standard` |
| `authenticationPolicyId` | integer |  | ID of the authentication policy to apply on this account |
| `city` | string |  | city |
| `company` | string |  | Company name |
| `configured` | boolean | read-only | Indicates if the account is configured |
| `countryCode` | email.exchange.CountryCodeEnum |  | Country code — one of `AC`, `AD`, `AE`, `AF`, `AG`, `AI`, `AL`, `AM`, `AO`, `AQ`, `AR`, `AS`, … |
| `creationDate` | string (date-time) | read-only | Creation date |
| `currentUsage` | integer | read-only | Mailbox usage |
| `customIsolationId` | integer | read-only | custom isolation apply on this account |
| `deleteAtExpiration` | boolean |  | delete at expiration |
| `deleteOutlookAtExpiration` | boolean |  | delete outlook at expiration |
| `description` | string |  | Description |
| `displayName` | string |  | Account display name |
| `domain` | string |  | Email domain |
| `exchangeGuid` | string | read-only | exchangeGuid for manual configuration |
| `expirationDate` | string (date-time) | read-only | expiration date |
| `expirationOutlookDate` | string (date-time) | read-only | expiration date |
| `fax` | phoneNumber |  | Fax number |
| `firstName` | string |  | Account first name |
| `forwardingEmail` | string |  | Email address to forward email |
| `guid` | string | read-only | GUID for user in active directory |
| `hiddenFromGAL` | boolean |  | Hide account in Global Address List |
| `id` | integer | read-only | Account id |
| `initial` | string |  | Account initials |
| `jobDepartment` | string |  | Job Department |
| `jobTitle` | string |  | Job title |
| `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 |
| `litigation` | boolean |  | Litigation hold feature enabled on this mailbox |
| `litigationPeriod` | integer |  | Litigation hold period in days (0 means unlimited). This setting covers all items in the mailbox. |
| `login` | string |  | Account login |
| `mailSenderDisplay` | string |  | Email display as sender |
| `mailingFilter` | email.exchange.MailingFilterEnum[] |  | Enable or disable anti-virus and anti-spam |
| `mobile` | phoneNumber |  | Mobile phone |
| `numberOfAliases` | integer | read-only | Count the number of related aliases attached to this account |
| `office` | string |  | Job office |
| `outlookLicense` | boolean |  | Outlook licence |
| `owaLimited` | boolean | read-only | OWA policy restriction is applied |
| `passwordLastUpdate` | string (date-time) | read-only | Time of account's password last update |
| `phone` | phoneNumber |  | Phone number |
| `postalCode` | string |  | Postal code |
| `primaryEmailAddress` | string | read-only | Default email for this mailbox |
| `quota` | integer |  | Account maximum size |
| `region` | string |  | region |
| `renewOutlookPeriod` | email.exchange.renewPeriodEnum |  | change the renew period for outlook — one of `monthly`, `yearly` |
| `renewPeriod` | email.exchange.renewPeriodEnum |  | change the renew period — one of `monthly`, `yearly` |
| `sbrDestination` | string |  | Relay domain address that will be used to all e-mails send from this account |
| `sendConnectorId` | integer |  | Custom sendConnectorId used to send mails when SBR is configured |
| `spamAndVirusConfiguration` | email.exchange.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.exchange.ObjectStateEnum | read-only | Account state — one of `creating`, `deleting`, `internalMigration`, `ok`, `reopening`, `suspended`, `suspending` |
| `storeCopyOfEmail` | boolean |  | Store copy of email when forward is enable |
| `streetAddress` | string |  | Street address |
| `taskPendingId` | integer | read-only | Pending task for this account |

```json
{
  "SAMAccountName": "string",
  "accountLicense": "basic",
  "authenticationPolicyId": 0,
  "city": "string",
  "company": "string",
  "configured": true,
  "countryCode": "AC",
  "creationDate": "2024-01-01T12:00:00Z",
  "currentUsage": 0,
  "customIsolationId": 0,
  "deleteAtExpiration": true,
  "deleteOutlookAtExpiration": true,
  "description": "string",
  "displayName": "string",
  "domain": "string",
  "exchangeGuid": "string",
  "expirationDate": "2024-01-01T12:00:00Z",
  "expirationOutlookDate": "2024-01-01T12:00:00Z",
  "fax": "string",
  "firstName": "string",
  "forwardingEmail": "string",
  "guid": "string",
  "hiddenFromGAL": true,
  "id": 0,
  "initial": "string",
  "jobDepartment": "string",
  "jobTitle": "string",
  "lastLogoffDate": "2024-01-01T12:00:00Z",
  "lastLogonDate": "2024-01-01T12:00:00Z",
  "lastName": "string",
  "lastUpdateDate": "2024-01-01T12:00:00Z",
  "litigation": true,
  "litigationPeriod": 0,
  "login": "string",
  "mailSenderDisplay": "string",
  "mailingFilter": [
    "vaderetro"
  ],
  "mobile": "string",
  "numberOfAliases": 0,
  "office": "string",
  "outlookLicense": true,
  "owaLimited": true,
  "passwordLastUpdate": "2024-01-01T12:00:00Z",
  "phone": "string",
  "postalCode": "string",
  "primaryEmailAddress": "string",
  "quota": 0,
  "region": "string",
  "renewOutlookPeriod": "monthly",
  "renewPeriod": "monthly",
  "sbrDestination": "string",
  "sendConnectorId": 0,
  "spamAndVirusConfiguration": {
    "checkDKIM": true,
    "checkSPF": true,
    "deleteSpam": true,
    "deleteVirus": true,
    "putInJunk": true,
  …
```

### Example

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

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}");

print_r($result);
?>
```

## Create an email account

`POST /1.0/email/exchange/{organizationName}/service/{exchangeService}/account`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#post-email-exchange-organizationname-service-exchangeservice-account

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

Create an email account. Creates an email account from a `login`, a `domain`, a `password` and a `license`, and returns the task. Set `quota` in GB.

### Parameters

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

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `SAMAccountName` | string |  | SAM account name (exchange 2010 login) |
| `authenticationPolicyId` | integer |  | ID of the authentication policy |
| `city` | string |  | City |
| `company` | string |  | Company name |
| `countryCode` | email.exchange.CountryCodeEnum |  | Country code — one of `AC`, `AD`, `AE`, `AF`, `AG`, `AI`, `AL`, `AM`, `AO`, `AQ`, `AR`, `AS`, … |
| `description` | string |  | Description |
| `displayName` | string |  | Account display name |
| `domain` | string | yes | Email domain |
| `fax` | phoneNumber |  | Fax number |
| `firstName` | string |  | Account first name |
| `forwardingEmail` | string |  | Email address to forward email |
| `hiddenFromGAL` | boolean |  | Hide the account in Global Address List |
| `initials` | string |  | Account initials |
| `jobDepartment` | string |  | Job department |
| `jobTitle` | string |  | Job title |
| `lastName` | string |  | Account last name |
| `license` | email.exchange.OvhLicenceEnum | yes | Exchange license — one of `basic`, `enterprise`, `standard` |
| `litigation` | boolean |  | Litigation status |
| `litigationPeriod` | integer |  | Litigation length in days, 0 means unlimited |
| `login` | string | yes | Account login |
| `mailSenderDisplay` | string |  | Email display as sender |
| `mailingFilter` | email.exchange.MailingFilterEnum[] |  | Enable mailing filtrering |
| `mobile` | phoneNumber |  | Mobile phone number |
| `office` | string |  | office |
| `outlookLicense` | boolean |  | Buy outlook license |
| `password` | string (password) | yes | Account password |
| `phone` | phoneNumber |  | Phone Number |
| `postalCode` | string |  | Postal code |
| `quota` | integer |  | Quota specified in GB. Check pricing table before use |
| `region` | string |  | Region |
| `sbrDestination` | string |  | Sender base routing destination domain |
| `sendConnectorId` | integer |  | Send connector id used to send mails when SBR is defined |
| `spamAndVirusConfiguration` | email.exchange.spamAndVirusConfiguration |  | Antispam 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 |
| `storeCopyOfEmail` | boolean |  | Store copy of email when forward is enable |
| `streetAddress` | string |  | Street address |

```json
{
  "SAMAccountName": "string",
  "authenticationPolicyId": 0,
  "city": "string",
  "company": "string",
  "countryCode": "AC",
  "description": "string",
  "displayName": "string",
  "domain": "string",
  "fax": "string",
  "firstName": "string",
  "forwardingEmail": "string",
  "hiddenFromGAL": true,
  "initials": "string",
  "jobDepartment": "string",
  "jobTitle": "string",
  "lastName": "string",
  "license": "basic",
  "litigation": true,
  "litigationPeriod": 0,
  "login": "string",
  "mailSenderDisplay": "string",
  "mailingFilter": [
    "vaderetro"
  ],
  "mobile": "string",
  "office": "string",
  "outlookLicense": true,
  "password": "string",
  "phone": "string",
  "postalCode": "string",
  "quota": 0,
  "region": "string",
  "sbrDestination": "string",
  "sendConnectorId": 0,
  "spamAndVirusConfiguration": {
    "checkDKIM": true,
    "checkSPF": true,
    "deleteSpam": true,
    "deleteVirus": true,
    "putInJunk": true,
    "tagSpam": true,
    "tagVirus": true
  },
  "storeCopyOfEmail": true,
  "streetAddress": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.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": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

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

# Request body type: string
result = client.post("/email/exchange/{organizationName}/service/{exchangeService}/account",
	SAMAccountName = None, # SAM account name (exchange 2010 login) (type: string, nullable)
	authenticationPolicyId = None, # ID of the authentication policy (type: long, nullable)
	city = None, # City (type: string, nullable)
	company = None, # Company name (type: string, nullable)
	countryCode = None, # Country code (type: email.exchange.CountryCodeEnum, nullable)
	description = None, # Description (type: string, nullable)
	displayName = None, # Account display name (type: string, nullable)
	domain = None, # Email domain (type: string)
	fax = None, # Fax number (type: phoneNumber, nullable)
	firstName = None, # Account first name (type: string, nullable)
	forwardingEmail = None, # Email address to forward email (type: string, nullable)
	hiddenFromGAL = None, # Hide the account in Global Address List (type: boolean, nullable)
	initials = None, # Account initials (type: string, nullable)
	jobDepartment = None, # Job department (type: string, nullable)
	jobTitle = None, # Job title (type: string, nullable)
	lastName = None, # Account last name (type: string, nullable)
	license = None, # Exchange license (type: email.exchange.OvhLicenceEnum)
	litigation = None, # Litigation status (type: boolean, nullable)
	litigationPeriod = None, # Litigation length in days, 0 means unlimited (type: long, nullable)
	login = None, # Account login (type: string)
	mailSenderDisplay = None, # Email display as sender (type: string, nullable)
	mailingFilter = None, # Enable mailing filtrering (type: email.exchange.MailingFilterEnum[], nullable)
	mobile = None, # Mobile phone number (type: phoneNumber, nullable)
	office = None, # office (type: string, nullable)
	outlookLicense = None, # Buy outlook license (type: boolean, nullable)
	password = None, # Account password (type: password)
	phone = None, # Phone Number (type: phoneNumber, nullable)
	postalCode = None, # Postal code (type: string, nullable)
	quota = None, # Quota specified in GB. Check pricing table before use (type: long, nullable)
	region = None, # Region (type: string, nullable)
	sbrDestination = None, # Sender base routing destination domain (type: string, nullable)
	sendConnectorId = None, # Send connector id used to send mails when SBR is defined (type: long, nullable)
	spamAndVirusConfiguration = None, # Antispam and Antivirus configuration (type: email.exchange.spamAndVirusConfiguration, nullable)
	storeCopyOfEmail = None, # Store copy of email when forward is enable (type: boolean, nullable)
	streetAddress = None, # Street address (type: string, 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

// Request body type: string
$result = $ovh->post("/email/exchange/{organizationName}/service/{exchangeService}/account", array(
	SAMAccountName => null, // SAM account name (exchange 2010 login) (type: string, nullable)
	authenticationPolicyId => null, // ID of the authentication policy (type: long, nullable)
	city => null, // City (type: string, nullable)
	company => null, // Company name (type: string, nullable)
	countryCode => null, // Country code (type: email.exchange.CountryCodeEnum, nullable)
	description => null, // Description (type: string, nullable)
	displayName => null, // Account display name (type: string, nullable)
	domain => null, // Email domain (type: string)
	fax => null, // Fax number (type: phoneNumber, nullable)
	firstName => null, // Account first name (type: string, nullable)
	forwardingEmail => null, // Email address to forward email (type: string, nullable)
	hiddenFromGAL => null, // Hide the account in Global Address List (type: boolean, nullable)
	initials => null, // Account initials (type: string, nullable)
	jobDepartment => null, // Job department (type: string, nullable)
	jobTitle => null, // Job title (type: string, nullable)
	lastName => null, // Account last name (type: string, nullable)
	license => null, // Exchange license (type: email.exchange.OvhLicenceEnum)
	litigation => null, // Litigation status (type: boolean, nullable)
	litigationPeriod => null, // Litigation length in days, 0 means unlimited (type: long, nullable)
	login => null, // Account login (type: string)
	mailSenderDisplay => null, // Email display as sender (type: string, nullable)
	mailingFilter => null, // Enable mailing filtrering (type: email.exchange.MailingFilterEnum[], nullable)
	mobile => null, // Mobile phone number (type: phoneNumber, nullable)
	office => null, // office (type: string, nullable)
	outlookLicense => null, // Buy outlook license (type: boolean, nullable)
	password => null, // Account password (type: password)
	phone => null, // Phone Number (type: phoneNumber, nullable)
	postalCode => null, // Postal code (type: string, nullable)
	quota => null, // Quota specified in GB. Check pricing table before use (type: long, nullable)
	region => null, // Region (type: string, nullable)
	sbrDestination => null, // Sender base routing destination domain (type: string, nullable)
	sendConnectorId => null, // Send connector id used to send mails when SBR is defined (type: long, nullable)
	spamAndVirusConfiguration => null, // Antispam and Antivirus configuration (type: email.exchange.spamAndVirusConfiguration, nullable)
	storeCopyOfEmail => null, // Store copy of email when forward is enable (type: boolean, nullable)
	streetAddress => null, // Street address (type: string, nullable)
));

print_r($result);
?>
```

## Delete an email account

`DELETE /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#delete-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress

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

Delete an email account. Deletes the email account and returns the task. On Hosted Exchange, the account is reset instead: its content is deleted and it becomes an unconfigured slot in `configureme.me` that keeps its subscription.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.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": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

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

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}");

print_r($result);
?>
```

## Update an email account

`PUT /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#put-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress

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

Update an email account. Updates the names, license, quota, renewal, forwarding, litigation hold, spam settings, authentication policy and contact details of the email account.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Request body (required)

Type: `email.exchange.Account`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `SAMAccountName` | string | read-only | SAM account name |
| `accountLicense` | email.exchange.OvhLicenceEnum |  | Exchange account type — one of `basic`, `enterprise`, `standard` |
| `authenticationPolicyId` | integer |  | ID of the authentication policy to apply on this account |
| `city` | string |  | city |
| `company` | string |  | Company name |
| `configured` | boolean | read-only | Indicates if the account is configured |
| `countryCode` | email.exchange.CountryCodeEnum |  | Country code — one of `AC`, `AD`, `AE`, `AF`, `AG`, `AI`, `AL`, `AM`, `AO`, `AQ`, `AR`, `AS`, … |
| `creationDate` | string (date-time) | read-only | Creation date |
| `currentUsage` | integer | read-only | Mailbox usage |
| `customIsolationId` | integer | read-only | custom isolation apply on this account |
| `deleteAtExpiration` | boolean |  | delete at expiration |
| `deleteOutlookAtExpiration` | boolean |  | delete outlook at expiration |
| `description` | string |  | Description |
| `displayName` | string |  | Account display name |
| `domain` | string |  | Email domain |
| `exchangeGuid` | string | read-only | exchangeGuid for manual configuration |
| `expirationDate` | string (date-time) | read-only | expiration date |
| `expirationOutlookDate` | string (date-time) | read-only | expiration date |
| `fax` | phoneNumber |  | Fax number |
| `firstName` | string |  | Account first name |
| `forwardingEmail` | string |  | Email address to forward email |
| `guid` | string | read-only | GUID for user in active directory |
| `hiddenFromGAL` | boolean |  | Hide account in Global Address List |
| `id` | integer | read-only | Account id |
| `initial` | string |  | Account initials |
| `jobDepartment` | string |  | Job Department |
| `jobTitle` | string |  | Job title |
| `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 |
| `litigation` | boolean |  | Litigation hold feature enabled on this mailbox |
| `litigationPeriod` | integer |  | Litigation hold period in days (0 means unlimited). This setting covers all items in the mailbox. |
| `login` | string |  | Account login |
| `mailSenderDisplay` | string |  | Email display as sender |
| `mailingFilter` | email.exchange.MailingFilterEnum[] |  | Enable or disable anti-virus and anti-spam |
| `mobile` | phoneNumber |  | Mobile phone |
| `numberOfAliases` | integer | read-only | Count the number of related aliases attached to this account |
| `office` | string |  | Job office |
| `outlookLicense` | boolean |  | Outlook licence |
| `owaLimited` | boolean | read-only | OWA policy restriction is applied |
| `passwordLastUpdate` | string (date-time) | read-only | Time of account's password last update |
| `phone` | phoneNumber |  | Phone number |
| `postalCode` | string |  | Postal code |
| `primaryEmailAddress` | string | read-only | Default email for this mailbox |
| `quota` | integer |  | Account maximum size |
| `region` | string |  | region |
| `renewOutlookPeriod` | email.exchange.renewPeriodEnum |  | change the renew period for outlook — one of `monthly`, `yearly` |
| `renewPeriod` | email.exchange.renewPeriodEnum |  | change the renew period — one of `monthly`, `yearly` |
| `sbrDestination` | string |  | Relay domain address that will be used to all e-mails send from this account |
| `sendConnectorId` | integer |  | Custom sendConnectorId used to send mails when SBR is configured |
| `spamAndVirusConfiguration` | email.exchange.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.exchange.ObjectStateEnum | read-only | Account state — one of `creating`, `deleting`, `internalMigration`, `ok`, `reopening`, `suspended`, `suspending` |
| `storeCopyOfEmail` | boolean |  | Store copy of email when forward is enable |
| `streetAddress` | string |  | Street address |
| `taskPendingId` | integer | read-only | Pending task for this account |

```json
{
  "accountLicense": "basic",
  "authenticationPolicyId": 0,
  "city": "string",
  "company": "string",
  "countryCode": "AC",
  "deleteAtExpiration": true,
  "deleteOutlookAtExpiration": true,
  "description": "string",
  "displayName": "string",
  "domain": "string",
  "fax": "string",
  "firstName": "string",
  "forwardingEmail": "string",
  "hiddenFromGAL": true,
  "initial": "string",
  "jobDepartment": "string",
  "jobTitle": "string",
  "lastName": "string",
  "litigation": true,
  "litigationPeriod": 0,
  "login": "string",
  "mailSenderDisplay": "string",
  "mailingFilter": [
    "vaderetro"
  ],
  "mobile": "string",
  "office": "string",
  "outlookLicense": true,
  "phone": "string",
  "postalCode": "string",
  "quota": 0,
  "region": "string",
  "renewOutlookPeriod": "monthly",
  "renewPeriod": "monthly",
  "sbrDestination": "string",
  "sendConnectorId": 0,
  "spamAndVirusConfiguration": {
    "checkDKIM": true,
    "checkSPF": true,
    "deleteSpam": true,
    "deleteVirus": true,
    "putInJunk": true,
    "tagSpam": true,
    "tagVirus": true
  },
  "storeCopyOfEmail": true,
  "streetAddress": "string"
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}" \
  -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.exchange.Account
result = client.put("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}",
	accountLicense = None, # Exchange account type (type: email.exchange.OvhLicenceEnum)
	authenticationPolicyId = None, # ID of the authentication policy to apply on this account (type: integer, nullable)
	city = None, # city (type: string, nullable)
	company = None, # Company name (type: string, nullable)
	countryCode = None, # Country code (type: email.exchange.CountryCodeEnum, nullable)
	deleteAtExpiration = None, # delete at expiration (type: boolean, nullable)
	deleteOutlookAtExpiration = None, # delete outlook at expiration (type: boolean, nullable)
	description = None, # Description (type: string, nullable)
	displayName = None, # Account display name (type: string, nullable)
	domain = None, # Email domain (type: string)
	fax = None, # Fax number (type: phoneNumber, nullable)
	firstName = None, # Account first name (type: string, nullable)
	forwardingEmail = None, # Email address to forward email (type: string, nullable)
	hiddenFromGAL = None, # Hide account in Global Address List (type: boolean)
	initial = None, # Account initials (type: string, nullable)
	jobDepartment = None, # Job Department (type: string, nullable)
	jobTitle = None, # Job title (type: string, nullable)
	lastName = None, # Account last name (type: string, nullable)
	litigation = None, # Litigation hold feature enabled on this mailbox (type: boolean)
	litigationPeriod = None, # Litigation hold period in days (0 means unlimited). This setting covers all items in the mailbox. (type: integer, nullable)
	login = None, # Account login (type: string)
	mailSenderDisplay = None, # Email display as sender (type: string, nullable)
	mailingFilter = None, # Enable or disable anti-virus and anti-spam (type: array, nullable)
	mobile = None, # Mobile phone (type: phoneNumber, nullable)
	office = None, # Job office (type: string, nullable)
	outlookLicense = None, # Outlook licence (type: boolean)
	phone = None, # Phone number (type: phoneNumber, nullable)
	postalCode = None, # Postal code (type: string, nullable)
	quota = None, # Account maximum size (type: integer)
	region = None, # region (type: string, nullable)
	renewOutlookPeriod = None, # change the renew period for outlook (type: email.exchange.renewPeriodEnum, nullable)
	renewPeriod = None, # change the renew period (type: email.exchange.renewPeriodEnum, nullable)
	sbrDestination = None, # Relay domain address that will be used to all e-mails send from this account (type: string, nullable)
	sendConnectorId = None, # Custom sendConnectorId used to send mails when SBR is configured (type: integer, nullable)
	spamAndVirusConfiguration = None, # Spam and Antivirus configuration (type: email.exchange.spamAndVirusConfiguration)
	storeCopyOfEmail = None, # Store copy of email when forward is enable (type: boolean)
	streetAddress = None, # Street address (type: string, 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

// Request body type: email.exchange.Account
$result = $ovh->put("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}", array(
	accountLicense => null, // Exchange account type (type: email.exchange.OvhLicenceEnum)
	authenticationPolicyId => null, // ID of the authentication policy to apply on this account (type: integer, nullable)
	city => null, // city (type: string, nullable)
	company => null, // Company name (type: string, nullable)
	countryCode => null, // Country code (type: email.exchange.CountryCodeEnum, nullable)
	deleteAtExpiration => null, // delete at expiration (type: boolean, nullable)
	deleteOutlookAtExpiration => null, // delete outlook at expiration (type: boolean, nullable)
	description => null, // Description (type: string, nullable)
	displayName => null, // Account display name (type: string, nullable)
	domain => null, // Email domain (type: string)
	fax => null, // Fax number (type: phoneNumber, nullable)
	firstName => null, // Account first name (type: string, nullable)
	forwardingEmail => null, // Email address to forward email (type: string, nullable)
	hiddenFromGAL => null, // Hide account in Global Address List (type: boolean)
	initial => null, // Account initials (type: string, nullable)
	jobDepartment => null, // Job Department (type: string, nullable)
	jobTitle => null, // Job title (type: string, nullable)
	lastName => null, // Account last name (type: string, nullable)
	litigation => null, // Litigation hold feature enabled on this mailbox (type: boolean)
	litigationPeriod => null, // Litigation hold period in days (0 means unlimited). This setting covers all items in the mailbox. (type: integer, nullable)
	login => null, // Account login (type: string)
	mailSenderDisplay => null, // Email display as sender (type: string, nullable)
	mailingFilter => null, // Enable or disable anti-virus and anti-spam (type: array, nullable)
	mobile => null, // Mobile phone (type: phoneNumber, nullable)
	office => null, // Job office (type: string, nullable)
	outlookLicense => null, // Outlook licence (type: boolean)
	phone => null, // Phone number (type: phoneNumber, nullable)
	postalCode => null, // Postal code (type: string, nullable)
	quota => null, // Account maximum size (type: integer)
	region => null, // region (type: string, nullable)
	renewOutlookPeriod => null, // change the renew period for outlook (type: email.exchange.renewPeriodEnum, nullable)
	renewPeriod => null, // change the renew period (type: email.exchange.renewPeriodEnum, nullable)
	sbrDestination => null, // Relay domain address that will be used to all e-mails send from this account (type: string, nullable)
	sendConnectorId => null, // Custom sendConnectorId used to send mails when SBR is configured (type: integer, nullable)
	spamAndVirusConfiguration => null, // Spam and Antivirus configuration (type: email.exchange.spamAndVirusConfiguration)
	storeCopyOfEmail => null, // Store copy of email when forward is enable (type: boolean)
	streetAddress => null, // Street address (type: string, nullable)
));

print_r($result);
?>
```

## Get the archive mailbox

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/archive`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#get-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-archive

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/archive/get`

Get the archive mailbox. Returns the quota in GB, the usage, the state and the creation date of the archive mailbox.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.exchangeAccountArchive | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creationDate` | string (date-time) | read-only | Creation date |
| `currentUsage` | integer | read-only | Archive mailbox usage |
| `guid` | string | read-only | GUID of archive mailbox |
| `quota` | integer |  | Archive mailbox maximum size in GB |
| `state` | email.exchange.ObjectStateEnum | read-only | Archive mailbox state — one of `creating`, `deleting`, `internalMigration`, `ok`, `reopening`, `suspended`, `suspending` |
| `taskPendingId` | integer | read-only | Pending task for this archive mailbox |

```json
{
  "creationDate": "2024-01-01T12:00:00Z",
  "currentUsage": 0,
  "guid": "string",
  "quota": 0,
  "state": "creating",
  "taskPendingId": 0
}
```

### Example

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

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/archive");

print_r($result);
?>
```

## Create an archive mailbox

`POST /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/archive`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#post-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-archive

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/archive/create`

Create an archive mailbox. Creates the archive mailbox of the email account and returns the task. Without `quota`, the archive gets the quota of the mailbox.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `quota` | integer |  | Archive mailbox quota (if not provided mailbox quota will be taken) |

```json
{
  "quota": 0
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.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": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/archive" \
  -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: long
result = client.post("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/archive",
	quota = None, # Archive mailbox quota (if not provided mailbox quota will be taken) (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

// Request body type: long
$result = $ovh->post("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/archive", array(
	quota => null, // Archive mailbox quota (if not provided mailbox quota will be taken) (type: long, nullable)
));

print_r($result);
?>
```

## Delete the archive mailbox

`DELETE /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/archive`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#delete-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-archive

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/archive/delete`

Delete the archive mailbox. Deletes the archive mailbox of the email account with the emails archived in it, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.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": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/archive" \
  -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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/archive")

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/archive");

print_r($result);
?>
```

## Update the archive mailbox quota

`PUT /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/archive`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#put-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-archive

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/archive/edit`

Update the archive mailbox quota. Sets the maximum size of the archive mailbox of the email account (`quota`, in GB).

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Request body (required)

Type: `email.exchange.exchangeAccountArchive`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creationDate` | string (date-time) | read-only | Creation date |
| `currentUsage` | integer | read-only | Archive mailbox usage |
| `guid` | string | read-only | GUID of archive mailbox |
| `quota` | integer |  | Archive mailbox maximum size in GB |
| `state` | email.exchange.ObjectStateEnum | read-only | Archive mailbox state — one of `creating`, `deleting`, `internalMigration`, `ok`, `reopening`, `suspended`, `suspending` |
| `taskPendingId` | integer | read-only | Pending task for this archive mailbox |

```json
{
  "quota": 0
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/archive" \
  -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.exchange.exchangeAccountArchive
result = client.put("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/archive",
	quota = None, # Archive mailbox maximum size in GB (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.exchange.exchangeAccountArchive
$result = $ovh->put("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/archive", array(
	quota => null, // Archive mailbox maximum size in GB (type: integer)
));

print_r($result);
?>
```

## Change an email account password

`POST /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/changePassword`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#post-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-changepassword

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

Change an email account password. Changes the password and returns the task. Set `forcePasswordChangeAtNextLogon` to make the user change it at the next logon.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `forcePasswordChangeAtNextLogon` | boolean |  | The password will need to be changed at the next time you log on |
| `password` | string (password) |  | New password |

```json
{
  "forcePasswordChangeAtNextLogon": true,
  "password": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.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": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

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

result = client.post("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/changePassword",
	forcePasswordChangeAtNextLogon = None, # The password will need to be changed at the next time you log on (type: boolean, nullable)
	password = None, # New password (type: password, 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/changePassword", array(
	forcePasswordChangeAtNextLogon => null, // The password will need to be changed at the next time you log on (type: boolean, nullable)
	password => null, // New password (type: password, nullable)
));

print_r($result);
?>
```

## Get the PST export

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/export`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#get-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-export

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/export/get`

Get the PST export. Returns the creation date and the completion percentage of the PST export of the email account.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Export | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creationDate` | string (date-time) | read-only | Creation date |
| `percentComplete` | integer | read-only | Percentage of export PST request completion |
| `taskPendingId` | integer | read-only | Task pending id |

```json
{
  "creationDate": "2024-01-01T12:00:00Z",
  "percentComplete": 0,
  "taskPendingId": 0
}
```

### Example

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

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/export");

print_r($result);
?>
```

## Request a PST export

`POST /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/export`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#post-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-export

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/export/create`

Request a PST export. Starts the export of the email account to a PST file, and returns the task. Follow its progress in `percentComplete`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.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": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

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

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/export");

print_r($result);
?>
```

## Delete the PST export

`DELETE /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/export`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#delete-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-export

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/export/delete`

Delete the PST export. Deletes the PST file exported from the email account and its download URL, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.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": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/export" \
  -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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/export")

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/export");

print_r($result);
?>
```

## Get the PST export URL

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/exportURL`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#get-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-exporturl

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/exportURL/get`

Get the PST export URL. Returns the temporary URL to download the PST export of the email account, and its expiration date.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.ExportUrl | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `expiration` | string (date-time) | read-only | Url expiration date |
| `url` | string | read-only | Export url |

```json
{
  "expiration": "2024-01-01T12:00:00Z",
  "url": "string"
}
```

### Example

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

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/exportURL");

print_r($result);
?>
```

## Generate a PST export URL

`POST /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/exportURL`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#post-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-exporturl

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/exportURL/create`

Generate a PST export URL. Generates a temporary URL to download the PST export of the email account, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.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": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

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

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/exportURL");

print_r($result);
?>
```

## Get the Outlook download URL

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/outlookURL`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#get-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-outlookurl

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/outlookURL/get`

Get the Outlook download URL. Returns the temporary Outlook download URL, its expiration date and the license serial number.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.OutlookUrl | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `expiration` | string (date-time) | read-only | Url expiration date |
| `serial` | string | read-only | Serial number |
| `url` | string | read-only | Outlook url |

```json
{
  "expiration": "2024-01-01T12:00:00Z",
  "serial": "string",
  "url": "string"
}
```

### Example

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

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/outlookURL");

print_r($result);
?>
```

## Generate an Outlook download URL

`POST /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/outlookURL`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#post-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-outlookurl

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/outlookURL/create`

Generate an Outlook download URL. Generates a temporary Outlook download URL for the given `version` and `language`, and returns the task. The email account needs an Outlook license.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `language` | email.exchange.LanguageEnum | yes | Language of outlook — one of `ar`, `bg`, `cz`, `da`, `de`, `el`, `en`, `es`, `et`, `fi`, `fr`, `he`, … |
| `version` | email.exchange.OutlookVersionEnum | yes | Version of outlook — one of `mac_x86_2016`, `mac_x86_2019`, `mac_x86_2021`, `windows_x64_2016`, `windows_x64_2019`, `windows_x64_2021`, `windows_x86_2016`, `windows_x86_2019`, `windows_x86_2021` |

```json
{
  "language": "ar",
  "version": "mac_x86_2016"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.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": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/outlookURL" \
  -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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/outlookURL",
	language = None, # Language of outlook (type: email.exchange.LanguageEnum)
	version = None, # Version of outlook (type: email.exchange.OutlookVersionEnum)
)

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/outlookURL", array(
	language => null, // Language of outlook (type: email.exchange.LanguageEnum)
	version => null, // Version of outlook (type: email.exchange.OutlookVersionEnum)
));

print_r($result);
?>
```

## Get the account protocols

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/protocol`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#get-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-protocol

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/protocol/get`

Get the account protocols. Returns whether POP, IMAP, webmail and ActiveSync are enabled on the email account.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.exchangeAccountProtocol | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `IMAP` | boolean |  | IMAP protocol enabled on that mailbox |
| `POP` | boolean |  | POP protocol enabled on that mailbox |
| `activeSync` | boolean |  | Mobile access enabled on that mailbox |
| `creationDate` | string (date-time) | read-only | Creation date |
| `lastUpdate` | string (date-time) | read-only | Last update date |
| `taskPendingId` | integer | read-only | Pending task id |
| `webMail` | boolean |  | Web mail enabled on that mailbox |

```json
{
  "IMAP": true,
  "POP": true,
  "activeSync": true,
  "creationDate": "2024-01-01T12:00:00Z",
  "lastUpdate": "2024-01-01T12:00:00Z",
  "taskPendingId": 0,
  "webMail": true
}
```

### Example

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

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/protocol");

print_r($result);
?>
```

## Update the account protocols

`PUT /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/protocol`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#put-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-protocol

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/protocol/edit`

Update the account protocols. Enables or disables POP, IMAP, webmail and ActiveSync on the email account.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Request body (required)

Type: `email.exchange.exchangeAccountProtocol`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `IMAP` | boolean |  | IMAP protocol enabled on that mailbox |
| `POP` | boolean |  | POP protocol enabled on that mailbox |
| `activeSync` | boolean |  | Mobile access enabled on that mailbox |
| `creationDate` | string (date-time) | read-only | Creation date |
| `lastUpdate` | string (date-time) | read-only | Last update date |
| `taskPendingId` | integer | read-only | Pending task id |
| `webMail` | boolean |  | Web mail enabled on that mailbox |

```json
{
  "IMAP": true,
  "POP": true,
  "activeSync": true,
  "webMail": true
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/protocol" \
  -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.exchange.exchangeAccountProtocol
result = client.put("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/protocol",
	IMAP = None, # IMAP protocol enabled on that mailbox (type: boolean)
	POP = None, # POP protocol enabled on that mailbox (type: boolean)
	activeSync = None, # Mobile access enabled on that mailbox (type: boolean)
	webMail = None, # Web mail enabled on that mailbox (type: boolean)
)

# 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.exchange.exchangeAccountProtocol
$result = $ovh->put("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/protocol", array(
	IMAP => null, // IMAP protocol enabled on that mailbox (type: boolean)
	POP => null, // POP protocol enabled on that mailbox (type: boolean)
	activeSync => null, // Mobile access enabled on that mailbox (type: boolean)
	webMail => null, // Web mail enabled on that mailbox (type: boolean)
));

print_r($result);
?>
```

## Terminate an email account at expiration

`POST /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/terminate`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#post-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-terminate

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/terminate`

Terminate an email account at expiration. Sets the email account to be suspended at its expiration date, and returns a message giving that date. Set `deleteAtExpiration` to false on the account to cancel.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

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

```json
"string"
```

### Example

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

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/terminate");

print_r($result);
?>
```

## List account aliases

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#get-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-alias

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/alias/get`

List account aliases. Returns the aliases of the email account: extra addresses that deliver to the same mailbox.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

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

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

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

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

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

result = client.get("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias")

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

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

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

$result = $ovh->get("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias");

print_r($result);
?>
```

## Get an account alias

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias/{alias}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#get-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-alias-alias

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/alias/get`

Get an account alias. Returns the alias address, its creation date and the ID of its pending task, if any (`taskPendingId`).

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `alias` | path | string | yes | Alias |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.exchangeAccountAlias | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `alias` | string | read-only | Alias |
| `creationDate` | string (date-time) | read-only | Creation date |
| `taskPendingId` | integer | read-only | Pending task id |

```json
{
  "alias": "string",
  "creationDate": "2024-01-01T12:00:00Z",
  "taskPendingId": 0
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias/{alias}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

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

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

result = client.get("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias/{alias}")

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

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

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

$result = $ovh->get("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias/{alias}");

print_r($result);
?>
```

## Create an account alias

`POST /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#post-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-alias

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/alias/create`

Create an account alias. Adds the `alias` address to the email account, so that it receives its emails, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `alias` | string | yes | Alias |

```json
{
  "alias": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.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": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN" \
  -H "content-type: application/json" \
  -d '{ }'
```

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

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

# Request body type: string
result = client.post("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias",
	alias = None, # Alias (type: 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: string
$result = $ovh->post("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias", array(
	alias => null, // Alias (type: string)
));

print_r($result);
?>
```

## Delete an account alias

`DELETE /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias/{alias}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#delete-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-alias-alias

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/alias/delete`

Delete an account alias. Removes the alias address from the email account, which no longer receives its emails, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `alias` | path | string | yes | Alias |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.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": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias/{alias}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

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

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

result = client.delete("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias/{alias}")

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

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

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

$result = $ovh->delete("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/alias/{alias}");

print_r($result);
?>
```

## List full access permissions

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/fullAccess`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#get-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-fullaccess

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/fullAccess/get`

List full access permissions. Returns the IDs of the accounts that have full access to the email account.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

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

```json
[
  0
]
```

### Example

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

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/fullAccess");

print_r($result);
?>
```

## Get a full access permission

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/fullAccess/{allowedAccountId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#get-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-fullaccess-allowedaccountid

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/fullAccess/get`

Get a full access permission. Returns the ID of the account allowed to open the mailbox of this email account, and the creation date of the right.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `allowedAccountId` | path | integer | yes | Account id to give full access |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.exchangeAccountFullAccess | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `allowedAccountId` | integer | read-only | Account id to give full access |
| `creationDate` | string (date-time) | read-only | Creation date |
| `taskPendingId` | integer | read-only | Pending task id |

```json
{
  "allowedAccountId": 0,
  "creationDate": "2024-01-01T12:00:00Z",
  "taskPendingId": 0
}
```

### Example

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

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/fullAccess/{allowedAccountId}");

print_r($result);
?>
```

## Add a full access permission

`POST /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/fullAccess`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#post-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-fullaccess

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/fullAccess/grant`

Add a full access permission. Gives the account given by `allowedAccountId` full access to the email account, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `allowedAccountId` | integer | yes | User to give full access |

```json
{
  "allowedAccountId": 0
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.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": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/fullAccess" \
  -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: long
result = client.post("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/fullAccess",
	allowedAccountId = None, # User to give full access (type: long)
)

# 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: long
$result = $ovh->post("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/fullAccess", array(
	allowedAccountId => null, // User to give full access (type: long)
));

print_r($result);
?>
```

## Remove a full access permission

`DELETE /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/fullAccess/{allowedAccountId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#delete-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-fullaccess-allowedaccountid

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/fullAccess/revoke`

Remove a full access permission. Withdraws the access of the allowed account to the mailbox of this email account, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `allowedAccountId` | path | integer | yes | Account id to give full access |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.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": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/fullAccess/{allowedAccountId}" \
  -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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/fullAccess/{allowedAccountId}")

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/fullAccess/{allowedAccountId}");

print_r($result);
?>
```

## List send as permissions

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendAs`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#get-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-sendas

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/sendAs/get`

List send as permissions. Returns the IDs of the accounts allowed to send emails as the email account.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

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

```json
[
  0
]
```

### Example

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

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendAs");

print_r($result);
?>
```

## Get a send as permission

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendAs/{allowedAccountId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#get-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-sendas-allowedaccountid

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/sendAs/get`

Get a send as permission. Returns the ID of the account allowed to send emails as this email account, and the creation date of the right.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `allowedAccountId` | path | integer | yes | Account id to give send as |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.exchangeAccountSendAs | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `allowedAccountId` | integer | read-only | Account id to give send as |
| `creationDate` | string (date-time) | read-only | Creation date |
| `taskPendingId` | integer | read-only | Pending task id |

```json
{
  "allowedAccountId": 0,
  "creationDate": "2024-01-01T12:00:00Z",
  "taskPendingId": 0
}
```

### Example

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

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendAs/{allowedAccountId}");

print_r($result);
?>
```

## Add a send as permission

`POST /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendAs`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#post-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-sendas

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/sendAs/grant`

Add a send as permission. Allows the account given by `allowAccountId` to send emails as the email account, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `allowAccountId` | integer | yes | Account id to allow to send mails from this mailbox |

```json
{
  "allowAccountId": 0
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.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": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendAs" \
  -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: long
result = client.post("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendAs",
	allowAccountId = None, # Account id to allow to send mails from this mailbox (type: long)
)

# 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: long
$result = $ovh->post("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendAs", array(
	allowAccountId => null, // Account id to allow to send mails from this mailbox (type: long)
));

print_r($result);
?>
```

## Remove a send as permission

`DELETE /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendAs/{allowedAccountId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#delete-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-sendas-allowedaccountid

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/sendAs/revoke`

Remove a send as permission. Withdraws the right of the allowed account to send emails as this email account, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `allowedAccountId` | path | integer | yes | Account id to give send as |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.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": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendAs/{allowedAccountId}" \
  -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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendAs/{allowedAccountId}")

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendAs/{allowedAccountId}");

print_r($result);
?>
```

## List send on behalf permissions

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendOnBehalfTo`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#get-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-sendonbehalfto

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/sendOnBehalfTo/get`

List send on behalf permissions. Returns the IDs of the accounts allowed to send emails on behalf of the email account.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

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

```json
[
  0
]
```

### Example

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

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendOnBehalfTo");

print_r($result);
?>
```

## Get a send on behalf permission

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendOnBehalfTo/{allowedAccountId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#get-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-sendonbehalfto-allowedaccountid

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/sendOnBehalfTo/get`

Get a send on behalf permission. Returns the ID of the account allowed to send emails on behalf of this email account, and the creation date of the right.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `allowedAccountId` | path | integer | yes | Account id to give send on behalf to |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.exchangeAccountSendOnBehalfTo | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `allowedAccountId` | integer | read-only | Account id to give send on behalf to |
| `creationDate` | string (date-time) | read-only | Creation date |
| `taskPendingId` | integer | read-only | Pending task id |

```json
{
  "allowedAccountId": 0,
  "creationDate": "2024-01-01T12:00:00Z",
  "taskPendingId": 0
}
```

### Example

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

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendOnBehalfTo/{allowedAccountId}");

print_r($result);
?>
```

## Add a send on behalf permission

`POST /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendOnBehalfTo`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#post-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-sendonbehalfto

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/sendOnBehalfTo/grant`

Add a send on behalf permission. Allows the account given by `allowAccountId` to send emails on behalf of the email account, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `allowAccountId` | integer | yes | Account id to allow to send On Behalf To mails from this mailbox |

```json
{
  "allowAccountId": 0
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.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": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendOnBehalfTo" \
  -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: long
result = client.post("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendOnBehalfTo",
	allowAccountId = None, # Account id to allow to send On Behalf To mails from this mailbox (type: long)
)

# 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: long
$result = $ovh->post("/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendOnBehalfTo", array(
	allowAccountId => null, // Account id to allow to send On Behalf To mails from this mailbox (type: long)
));

print_r($result);
?>
```

## Remove a send on behalf permission

`DELETE /1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendOnBehalfTo/{allowedAccountId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#delete-email-exchange-organizationname-service-exchangeservice-account-primaryemailaddress-sendonbehalfto-allowedaccountid

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/account/sendOnBehalfTo/revoke`

Remove a send on behalf permission. Withdraws the right of the allowed account to send emails on behalf of this email account, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `allowedAccountId` | path | integer | yes | Account id to give send on behalf to |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `organizationName` | path | string | yes | The internal name of your exchange organization |
| `primaryEmailAddress` | path | string | yes | Default email for this mailbox |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.exchange.TaskFunctionEnum | read-only | Function name — one of `activateSharepoint`, `addAccount`, `addAccountArchive`, `addAccountImpersonation`, `addActiveSyncMailNotification`, `addAlias`, `addDistributionGroup`, `addDistributionGroupManager`, `addDistributionGroupMember`, `addDistributionGroupSendAs`, `addDistributionGroupSendOnBehalfTo`, `addDomain`, … |
| `id` | integer | read-only | Task id |
| `status` | email.exchange.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": "activateSharepoint",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/email/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendOnBehalfTo/{allowedAccountId}" \
  -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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendOnBehalfTo/{allowedAccountId}")

# 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/exchange/{organizationName}/service/{exchangeService}/account/{primaryEmailAddress}/sendOnBehalfTo/{allowedAccountId}");

print_r($result);
?>
```

## List Active Directory accounts

`GET /1.0/msServices/{serviceName}/account`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#get-msservices-servicename-account

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

List Active Directory accounts. Returns the user principal names of the accounts of the Active Directory service. Filter them by `company`, `id` or `userPrincipalName`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `company` | query | string |  | Filter the value of company property (like) |
| `id` | query | integer |  | Filter the value of id property (like) |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |
| `userPrincipalName` | query | string |  | Filter the value of userPrincipalName property (like) |

### Responses

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

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

### Example

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

print_r($result);
?>
```

## Get an Active Directory account

`GET /1.0/msServices/{serviceName}/account/{userPrincipalName}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#get-msservices-servicename-account-userprincipalname

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

Get an Active Directory account. Returns the identity, contact details, job information, state and last logon and logoff dates of the account.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |
| `userPrincipalName` | path | string | yes | User Principal Name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | msServices.Account | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `SAMAccountName` | string | read-only | SAM account name |
| `city` | string |  | city |
| `company` | string |  | Company name |
| `countryCode` | email.exchange.CountryCodeEnum |  | Country code — one of `AC`, `AD`, `AE`, `AF`, `AG`, `AI`, `AL`, `AM`, `AO`, `AQ`, `AR`, `AS`, … |
| `creationDate` | string (date-time) | read-only | Creation date |
| `description` | string |  | Description |
| `displayName` | string |  | Account display name |
| `entraIdSynced` | boolean |  | Is synced to Entra ID |
| `fax` | phoneNumber |  | Fax number |
| `firstName` | string |  | Account first name |
| `guid` | string | read-only | GUID for user in active directory |
| `id` | integer | read-only | Account id |
| `initials` | string |  | Account initials |
| `jobDepartment` | string |  | Job Department |
| `jobTitle` | string |  | Job title |
| `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 |
| `mobile` | phoneNumber |  | Mobile phone |
| `office` | string |  | Job office |
| `passwordLastUpdate` | string (date-time) | read-only | Time of account's password last update |
| `phone` | phoneNumber |  | Phone number |
| `postalCode` | string |  | Postal code |
| `region` | string |  | region |
| `state` | msServices.ObjectStateEnum | read-only | Account state — one of `creating`, `deleting`, `disabled`, `modifying`, `ok`, `reopening`, `suspended`, `suspending` |
| `streetAddress` | string |  | Street address |
| `taskPendingId` | integer | read-only | Pending task for this account |
| `userPrincipalName` | string |  | User Principal Name |

```json
{
  "SAMAccountName": "string",
  "city": "string",
  "company": "string",
  "countryCode": "AC",
  "creationDate": "2024-01-01T12:00:00Z",
  "description": "string",
  "displayName": "string",
  "entraIdSynced": true,
  "fax": "string",
  "firstName": "string",
  "guid": "string",
  "id": 0,
  "initials": "string",
  "jobDepartment": "string",
  "jobTitle": "string",
  "lastLogoffDate": "2024-01-01T12:00:00Z",
  "lastLogonDate": "2024-01-01T12:00:00Z",
  "lastName": "string",
  "lastUpdateDate": "2024-01-01T12:00:00Z",
  "mobile": "string",
  "office": "string",
  "passwordLastUpdate": "2024-01-01T12:00:00Z",
  "phone": "string",
  "postalCode": "string",
  "region": "string",
  "state": "creating",
  "streetAddress": "string",
  "taskPendingId": 0,
  "userPrincipalName": "string"
}
```

### Example

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

# 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("/msServices/{serviceName}/account/{userPrincipalName}");

print_r($result);
?>
```

## Update an Active Directory account

`PUT /1.0/msServices/{serviceName}/account/{userPrincipalName}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#put-msservices-servicename-account-userprincipalname

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

Update an Active Directory account. Updates the user principal name, names, contact details and job information of the account.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |
| `userPrincipalName` | path | string | yes | User Principal Name |

### Request body (required)

Type: `msServices.Account`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `SAMAccountName` | string | read-only | SAM account name |
| `city` | string |  | city |
| `company` | string |  | Company name |
| `countryCode` | email.exchange.CountryCodeEnum |  | Country code — one of `AC`, `AD`, `AE`, `AF`, `AG`, `AI`, `AL`, `AM`, `AO`, `AQ`, `AR`, `AS`, … |
| `creationDate` | string (date-time) | read-only | Creation date |
| `description` | string |  | Description |
| `displayName` | string |  | Account display name |
| `entraIdSynced` | boolean |  | Is synced to Entra ID |
| `fax` | phoneNumber |  | Fax number |
| `firstName` | string |  | Account first name |
| `guid` | string | read-only | GUID for user in active directory |
| `id` | integer | read-only | Account id |
| `initials` | string |  | Account initials |
| `jobDepartment` | string |  | Job Department |
| `jobTitle` | string |  | Job title |
| `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 |
| `mobile` | phoneNumber |  | Mobile phone |
| `office` | string |  | Job office |
| `passwordLastUpdate` | string (date-time) | read-only | Time of account's password last update |
| `phone` | phoneNumber |  | Phone number |
| `postalCode` | string |  | Postal code |
| `region` | string |  | region |
| `state` | msServices.ObjectStateEnum | read-only | Account state — one of `creating`, `deleting`, `disabled`, `modifying`, `ok`, `reopening`, `suspended`, `suspending` |
| `streetAddress` | string |  | Street address |
| `taskPendingId` | integer | read-only | Pending task for this account |
| `userPrincipalName` | string |  | User Principal Name |

```json
{
  "city": "string",
  "company": "string",
  "countryCode": "AC",
  "description": "string",
  "displayName": "string",
  "entraIdSynced": true,
  "fax": "string",
  "firstName": "string",
  "initials": "string",
  "jobDepartment": "string",
  "jobTitle": "string",
  "lastName": "string",
  "mobile": "string",
  "office": "string",
  "phone": "string",
  "postalCode": "string",
  "region": "string",
  "streetAddress": "string",
  "userPrincipalName": "string"
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/msServices/{serviceName}/account/{userPrincipalName}" \
  -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: msServices.Account
result = client.put("/msServices/{serviceName}/account/{userPrincipalName}",
	city = None, # city (type: string, nullable)
	company = None, # Company name (type: string, nullable)
	countryCode = None, # Country code (type: email.exchange.CountryCodeEnum, nullable)
	description = None, # Description (type: string, nullable)
	displayName = None, # Account display name (type: string, nullable)
	entraIdSynced = None, # Is synced to Entra ID (type: boolean, nullable)
	fax = None, # Fax number (type: phoneNumber, nullable)
	firstName = None, # Account first name (type: string, nullable)
	initials = None, # Account initials (type: string, nullable)
	jobDepartment = None, # Job Department (type: string, nullable)
	jobTitle = None, # Job title (type: string, nullable)
	lastName = None, # Account last name (type: string, nullable)
	mobile = None, # Mobile phone (type: phoneNumber, nullable)
	office = None, # Job office (type: string, nullable)
	phone = None, # Phone number (type: phoneNumber, nullable)
	postalCode = None, # Postal code (type: string, nullable)
	region = None, # region (type: string, nullable)
	streetAddress = None, # Street address (type: string, nullable)
	userPrincipalName = None, # User Principal Name (type: 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: msServices.Account
$result = $ovh->put("/msServices/{serviceName}/account/{userPrincipalName}", array(
	city => null, // city (type: string, nullable)
	company => null, // Company name (type: string, nullable)
	countryCode => null, // Country code (type: email.exchange.CountryCodeEnum, nullable)
	description => null, // Description (type: string, nullable)
	displayName => null, // Account display name (type: string, nullable)
	entraIdSynced => null, // Is synced to Entra ID (type: boolean, nullable)
	fax => null, // Fax number (type: phoneNumber, nullable)
	firstName => null, // Account first name (type: string, nullable)
	initials => null, // Account initials (type: string, nullable)
	jobDepartment => null, // Job Department (type: string, nullable)
	jobTitle => null, // Job title (type: string, nullable)
	lastName => null, // Account last name (type: string, nullable)
	mobile => null, // Mobile phone (type: phoneNumber, nullable)
	office => null, // Job office (type: string, nullable)
	phone => null, // Phone number (type: phoneNumber, nullable)
	postalCode => null, // Postal code (type: string, nullable)
	region => null, // region (type: string, nullable)
	streetAddress => null, // Street address (type: string, nullable)
	userPrincipalName => null, // User Principal Name (type: string)
));

print_r($result);
?>
```

## Change the Active Directory password

`POST /1.0/msServices/{serviceName}/account/{userPrincipalName}/changePassword`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#post-msservices-servicename-account-userprincipalname-changepassword

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

Change the Active Directory password. Changes the password of the Active Directory account and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |
| `userPrincipalName` | path | string | yes | User Principal Name |

### Request body (required)

Type: `object`

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

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | msServices.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | msServices.TaskFunctionEnum | read-only | Function name — one of `activateADSync`, `activateSharepoint`, `addADAccount`, `addADOU`, `addADSyncAccount`, `addADUPNSuffix`, `alterMfaOnAllUsers`, `changeADPassword`, `changeADSyncPassword`, `deactivateADSync`, `delADOU`, `deleteADAccount`, … |
| `id` | integer | read-only | Task id |
| `status` | msServices.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": "activateADSync",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/msServices/{serviceName}/account/{userPrincipalName}/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("/msServices/{serviceName}/account/{userPrincipalName}/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("/msServices/{serviceName}/account/{userPrincipalName}/changePassword", array(
	password => null, // new password (type: password)
));

print_r($result);
?>
```

## Get an account mailbox

`GET /1.0/msServices/{serviceName}/account/{userPrincipalName}/exchange`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#get-msservices-servicename-account-userprincipalname-exchange

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

Get an account mailbox. Returns the Exchange mailbox of the Active Directory account: primary address, license, quota, usage, Outlook license, renewal and expiration settings, and spam and antivirus configuration.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |
| `userPrincipalName` | path | string | yes | User Principal Name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | msServices.ExchangeInformation | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accountLicense` | msServices.ExchangeLicenceEnum |  | Exchange account license — one of `basic`, `enterprise`, `standard` |
| `configured` | boolean | read-only | Indicates if the account is configured |
| `creationDate` | string (date-time) | read-only | Creation date |
| `currentUsage` | integer | read-only | Mailbox usage in KB |
| `deleteAtExpiration` | boolean |  | Delete mailbox at expiration date |
| `deleteOutlookAtExpiration` | boolean |  | Delete Outlook license at expiration date |
| `exchangeGuid` | string | read-only | Property needed for mailbox manual configuration (GUID) |
| `expirationDate` | string (date-time) | read-only | Expiration date |
| `expirationOutlookDate` | string (date-time) | read-only | Expiration date of Outlook license |
| `hiddenFromGAL` | boolean |  | Visibility in Global Address List |
| `id` | integer | read-only | Account id |
| `litigation` | boolean |  | Litigation hold feature enabled on this mailbox |
| `litigationPeriod` | integer |  | Litigation hold period in days (0 means unlimited). This setting covers all items in the mailbox. |
| `mailingFilter` | msServices.MailingFilterEnum[] |  | Enable or disable anti-virus and anti-spam |
| `numberOfAliases` | integer | read-only | Count the number of related aliases attached to this account |
| `outlookLicense` | boolean |  | Outlook licence attached |
| `owaLimited` | boolean | read-only | OWA policy restriction is applied |
| `primaryEmailAddress` | string | read-only | Primary address of the mailbox |
| `quota` | integer |  | Maximum mailbox usage in GB (overall size) |
| `renewOutlookPeriod` | msServices.RenewPeriodEnum |  | Frequency of Outlook license renewals — one of `monthly`, `yearly` |
| `renewPeriod` | msServices.RenewPeriodEnum |  | Frequency of mailbox license renewals — one of `monthly`, `yearly` |
| `spamAndVirusConfiguration` | msServices.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 | Spam activity detected on this mailbox |
| `spamTicketNumber` | integer | read-only | Ticket number of spam detection |
| `state` | msServices.ObjectStateEnum | read-only | Mailbox state — one of `creating`, `deleting`, `disabled`, `modifying`, `ok`, `reopening`, `suspended`, `suspending` |
| `taskPendingId` | integer | read-only | Pending task id for this account |

```json
{
  "accountLicense": "basic",
  "configured": true,
  "creationDate": "2024-01-01T12:00:00Z",
  "currentUsage": 0,
  "deleteAtExpiration": true,
  "deleteOutlookAtExpiration": true,
  "exchangeGuid": "string",
  "expirationDate": "2024-01-01T12:00:00Z",
  "expirationOutlookDate": "2024-01-01T12:00:00Z",
  "hiddenFromGAL": true,
  "id": 0,
  "litigation": true,
  "litigationPeriod": 0,
  "mailingFilter": [
    "vaderetro"
  ],
  "numberOfAliases": 0,
  "outlookLicense": true,
  "owaLimited": true,
  "primaryEmailAddress": "string",
  "quota": 0,
  "renewOutlookPeriod": "monthly",
  "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/msServices/{serviceName}/account/{userPrincipalName}/exchange" \
  -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("/msServices/{serviceName}/account/{userPrincipalName}/exchange")

# 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("/msServices/{serviceName}/account/{userPrincipalName}/exchange");

print_r($result);
?>
```

## Update an account mailbox

`PUT /1.0/msServices/{serviceName}/account/{userPrincipalName}/exchange`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#put-msservices-servicename-account-userprincipalname-exchange

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

Update an account mailbox. Updates the license, quota, Outlook license, renewal and deletion at expiration settings, litigation hold, Global Address List visibility and spam and antivirus configuration of the mailbox.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |
| `userPrincipalName` | path | string | yes | User Principal Name |

### Request body (required)

Type: `msServices.ExchangeInformation`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accountLicense` | msServices.ExchangeLicenceEnum |  | Exchange account license — one of `basic`, `enterprise`, `standard` |
| `configured` | boolean | read-only | Indicates if the account is configured |
| `creationDate` | string (date-time) | read-only | Creation date |
| `currentUsage` | integer | read-only | Mailbox usage in KB |
| `deleteAtExpiration` | boolean |  | Delete mailbox at expiration date |
| `deleteOutlookAtExpiration` | boolean |  | Delete Outlook license at expiration date |
| `exchangeGuid` | string | read-only | Property needed for mailbox manual configuration (GUID) |
| `expirationDate` | string (date-time) | read-only | Expiration date |
| `expirationOutlookDate` | string (date-time) | read-only | Expiration date of Outlook license |
| `hiddenFromGAL` | boolean |  | Visibility in Global Address List |
| `id` | integer | read-only | Account id |
| `litigation` | boolean |  | Litigation hold feature enabled on this mailbox |
| `litigationPeriod` | integer |  | Litigation hold period in days (0 means unlimited). This setting covers all items in the mailbox. |
| `mailingFilter` | msServices.MailingFilterEnum[] |  | Enable or disable anti-virus and anti-spam |
| `numberOfAliases` | integer | read-only | Count the number of related aliases attached to this account |
| `outlookLicense` | boolean |  | Outlook licence attached |
| `owaLimited` | boolean | read-only | OWA policy restriction is applied |
| `primaryEmailAddress` | string | read-only | Primary address of the mailbox |
| `quota` | integer |  | Maximum mailbox usage in GB (overall size) |
| `renewOutlookPeriod` | msServices.RenewPeriodEnum |  | Frequency of Outlook license renewals — one of `monthly`, `yearly` |
| `renewPeriod` | msServices.RenewPeriodEnum |  | Frequency of mailbox license renewals — one of `monthly`, `yearly` |
| `spamAndVirusConfiguration` | msServices.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 | Spam activity detected on this mailbox |
| `spamTicketNumber` | integer | read-only | Ticket number of spam detection |
| `state` | msServices.ObjectStateEnum | read-only | Mailbox state — one of `creating`, `deleting`, `disabled`, `modifying`, `ok`, `reopening`, `suspended`, `suspending` |
| `taskPendingId` | integer | read-only | Pending task id for this account |

```json
{
  "accountLicense": "basic",
  "deleteAtExpiration": true,
  "deleteOutlookAtExpiration": true,
  "hiddenFromGAL": true,
  "litigation": true,
  "litigationPeriod": 0,
  "mailingFilter": [
    "vaderetro"
  ],
  "outlookLicense": true,
  "quota": 0,
  "renewOutlookPeriod": "monthly",
  "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/msServices/{serviceName}/account/{userPrincipalName}/exchange" \
  -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: msServices.ExchangeInformation
result = client.put("/msServices/{serviceName}/account/{userPrincipalName}/exchange",
	accountLicense = None, # Exchange account license (type: msServices.ExchangeLicenceEnum)
	deleteAtExpiration = None, # Delete mailbox at expiration date (type: boolean, nullable)
	deleteOutlookAtExpiration = None, # Delete Outlook license at expiration date (type: boolean, nullable)
	hiddenFromGAL = None, # Visibility in Global Address List (type: boolean)
	litigation = None, # Litigation hold feature enabled on this mailbox (type: boolean)
	litigationPeriod = None, # Litigation hold period in days (0 means unlimited). This setting covers all items in the mailbox. (type: integer, nullable)
	mailingFilter = None, # Enable or disable anti-virus and anti-spam (type: array, nullable)
	outlookLicense = None, # Outlook licence attached (type: boolean)
	quota = None, # Maximum mailbox usage in GB (overall size) (type: integer)
	renewOutlookPeriod = None, # Frequency of Outlook license renewals (type: msServices.RenewPeriodEnum, nullable)
	renewPeriod = None, # Frequency of mailbox license renewals (type: msServices.RenewPeriodEnum, nullable)
	spamAndVirusConfiguration = None, # Spam and Antivirus configuration (type: msServices.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: msServices.ExchangeInformation
$result = $ovh->put("/msServices/{serviceName}/account/{userPrincipalName}/exchange", array(
	accountLicense => null, // Exchange account license (type: msServices.ExchangeLicenceEnum)
	deleteAtExpiration => null, // Delete mailbox at expiration date (type: boolean, nullable)
	deleteOutlookAtExpiration => null, // Delete Outlook license at expiration date (type: boolean, nullable)
	hiddenFromGAL => null, // Visibility in Global Address List (type: boolean)
	litigation => null, // Litigation hold feature enabled on this mailbox (type: boolean)
	litigationPeriod => null, // Litigation hold period in days (0 means unlimited). This setting covers all items in the mailbox. (type: integer, nullable)
	mailingFilter => null, // Enable or disable anti-virus and anti-spam (type: array, nullable)
	outlookLicense => null, // Outlook licence attached (type: boolean)
	quota => null, // Maximum mailbox usage in GB (overall size) (type: integer)
	renewOutlookPeriod => null, // Frequency of Outlook license renewals (type: msServices.RenewPeriodEnum, nullable)
	renewPeriod => null, // Frequency of mailbox license renewals (type: msServices.RenewPeriodEnum, nullable)
	spamAndVirusConfiguration => null, // Spam and Antivirus configuration (type: msServices.SpamAndVirusConfiguration)
));

print_r($result);
?>
```

## Get the account MFA

`GET /1.0/msServices/{serviceName}/account/{userPrincipalName}/mfa`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#get-msservices-servicename-account-userprincipalname-mfa

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

Get the account MFA. Returns whether MFA is activated on the Active Directory account, and its state.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |
| `userPrincipalName` | path | string | yes | User Principal Name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | msServices.MfaInformation | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `activated` | boolean | read-only | Indicates if Multi Factor Authentication is activated on this account |
| `state` | msServices.ObjectStateEnum | read-only | Current status of Multi Factor Authentication feature — one of `creating`, `deleting`, `disabled`, `modifying`, `ok`, `reopening`, `suspended`, `suspending` |
| `taskPendingId` | integer | read-only | Pending task for Multi Factor Authentication |

```json
{
  "activated": true,
  "state": "creating",
  "taskPendingId": 0
}
```

### Example

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

# 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("/msServices/{serviceName}/account/{userPrincipalName}/mfa");

print_r($result);
?>
```

## Create the account MFA

`POST /1.0/msServices/{serviceName}/account/{userPrincipalName}/mfa`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#post-msservices-servicename-account-userprincipalname-mfa

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

Create the account MFA. Creates MFA for the Active Directory account and returns the task. MFA is enabled by default when created.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |
| `userPrincipalName` | path | string | yes | User Principal Name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | msServices.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | msServices.TaskFunctionEnum | read-only | Function name — one of `activateADSync`, `activateSharepoint`, `addADAccount`, `addADOU`, `addADSyncAccount`, `addADUPNSuffix`, `alterMfaOnAllUsers`, `changeADPassword`, `changeADSyncPassword`, `deactivateADSync`, `delADOU`, `deleteADAccount`, … |
| `id` | integer | read-only | Task id |
| `status` | msServices.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": "activateADSync",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

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

# 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("/msServices/{serviceName}/account/{userPrincipalName}/mfa");

print_r($result);
?>
```

## Delete the account MFA

`DELETE /1.0/msServices/{serviceName}/account/{userPrincipalName}/mfa`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#delete-msservices-servicename-account-userprincipalname-mfa

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

Delete the account MFA. Removes the MFA of the Active Directory account and returns the task. The user signs in with a password only.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |
| `userPrincipalName` | path | string | yes | User Principal Name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | msServices.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | msServices.TaskFunctionEnum | read-only | Function name — one of `activateADSync`, `activateSharepoint`, `addADAccount`, `addADOU`, `addADSyncAccount`, `addADUPNSuffix`, `alterMfaOnAllUsers`, `changeADPassword`, `changeADSyncPassword`, `deactivateADSync`, `delADOU`, `deleteADAccount`, … |
| `id` | integer | read-only | Task id |
| `status` | msServices.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": "activateADSync",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/msServices/{serviceName}/account/{userPrincipalName}/mfa" \
  -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("/msServices/{serviceName}/account/{userPrincipalName}/mfa")

# 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("/msServices/{serviceName}/account/{userPrincipalName}/mfa");

print_r($result);
?>
```

## Disable the account MFA

`POST /1.0/msServices/{serviceName}/account/{userPrincipalName}/mfa/disable`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#post-msservices-servicename-account-userprincipalname-mfa-disable

**Status:** Stable production version  
**IAM actions:** `microsoftServices:apiovh:account/mfa/disable`

Disable the account MFA. Disables MFA on the Active Directory account for `period` hours, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |
| `userPrincipalName` | path | string | yes | User Principal Name |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `period` | integer | yes | Multi Factor Authentication disable period in hours |

```json
{
  "period": 0
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | msServices.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | msServices.TaskFunctionEnum | read-only | Function name — one of `activateADSync`, `activateSharepoint`, `addADAccount`, `addADOU`, `addADSyncAccount`, `addADUPNSuffix`, `alterMfaOnAllUsers`, `changeADPassword`, `changeADSyncPassword`, `deactivateADSync`, `delADOU`, `deleteADAccount`, … |
| `id` | integer | read-only | Task id |
| `status` | msServices.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": "activateADSync",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/msServices/{serviceName}/account/{userPrincipalName}/mfa/disable" \
  -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: long
result = client.post("/msServices/{serviceName}/account/{userPrincipalName}/mfa/disable",
	period = None, # Multi Factor Authentication disable period in hours (type: long)
)

# 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: long
$result = $ovh->post("/msServices/{serviceName}/account/{userPrincipalName}/mfa/disable", array(
	period => null, // Multi Factor Authentication disable period in hours (type: long)
));

print_r($result);
?>
```

## Enable the account MFA

`POST /1.0/msServices/{serviceName}/account/{userPrincipalName}/mfa/enable`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#post-msservices-servicename-account-userprincipalname-mfa-enable

**Status:** Stable production version  
**IAM actions:** `microsoftServices:apiovh:account/mfa/enable`

Enable the account MFA. Enables MFA on the Active Directory account and returns the task. MFA is enabled by default when created.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |
| `userPrincipalName` | path | string | yes | User Principal Name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | msServices.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | msServices.TaskFunctionEnum | read-only | Function name — one of `activateADSync`, `activateSharepoint`, `addADAccount`, `addADOU`, `addADSyncAccount`, `addADUPNSuffix`, `alterMfaOnAllUsers`, `changeADPassword`, `changeADSyncPassword`, `deactivateADSync`, `delADOU`, `deleteADAccount`, … |
| `id` | integer | read-only | Task id |
| `status` | msServices.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": "activateADSync",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/msServices/{serviceName}/account/{userPrincipalName}/mfa/enable" \
  -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("/msServices/{serviceName}/account/{userPrincipalName}/mfa/enable")

# 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("/msServices/{serviceName}/account/{userPrincipalName}/mfa/enable");

print_r($result);
?>
```

## Reset the account MFA

`POST /1.0/msServices/{serviceName}/account/{userPrincipalName}/mfa/reset`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#post-msservices-servicename-account-userprincipalname-mfa-reset

**Status:** Stable production version  
**IAM actions:** `microsoftServices:apiovh:account/mfa/reset`

Reset the account MFA. Resets the MFA of the Active Directory account, so that the user registers again at the next sign-in. Returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |
| `userPrincipalName` | path | string | yes | User Principal Name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | msServices.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | msServices.TaskFunctionEnum | read-only | Function name — one of `activateADSync`, `activateSharepoint`, `addADAccount`, `addADOU`, `addADSyncAccount`, `addADUPNSuffix`, `alterMfaOnAllUsers`, `changeADPassword`, `changeADSyncPassword`, `deactivateADSync`, `delADOU`, `deleteADAccount`, … |
| `id` | integer | read-only | Task id |
| `status` | msServices.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": "activateADSync",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/msServices/{serviceName}/account/{userPrincipalName}/mfa/reset" \
  -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("/msServices/{serviceName}/account/{userPrincipalName}/mfa/reset")

# 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("/msServices/{serviceName}/account/{userPrincipalName}/mfa/reset");

print_r($result);
?>
```

## Create MFA on all accounts

`POST /1.0/msServices/{serviceName}/createMfaOnAllUsers`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#post-msservices-servicename-createmfaonallusers

**Status:** Stable production version  
**IAM actions:** `microsoftServices:apiovh:createMfaOnAllUsers`

Create MFA on all accounts. Creates MFA for all the accounts of the Active Directory service and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | msServices.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | msServices.TaskFunctionEnum | read-only | Function name — one of `activateADSync`, `activateSharepoint`, `addADAccount`, `addADOU`, `addADSyncAccount`, `addADUPNSuffix`, `alterMfaOnAllUsers`, `changeADPassword`, `changeADSyncPassword`, `deactivateADSync`, `delADOU`, `deleteADAccount`, … |
| `id` | integer | read-only | Task id |
| `status` | msServices.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": "activateADSync",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/msServices/{serviceName}/createMfaOnAllUsers" \
  -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("/msServices/{serviceName}/createMfaOnAllUsers")

# 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("/msServices/{serviceName}/createMfaOnAllUsers");

print_r($result);
?>
```

## Remove MFA from all accounts

`POST /1.0/msServices/{serviceName}/removeMfaOnAllUsers`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/private-exchange/email-accounts/#post-msservices-servicename-removemfaonallusers

**Status:** Stable production version  
**IAM actions:** `microsoftServices:apiovh:removeMfaOnAllUsers`

Remove MFA from all accounts. Removes MFA from all the accounts of the Active Directory service and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `serviceName` | path | string | yes | The internal name of your Active Directory organization |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | msServices.Task | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | msServices.TaskFunctionEnum | read-only | Function name — one of `activateADSync`, `activateSharepoint`, `addADAccount`, `addADOU`, `addADSyncAccount`, `addADUPNSuffix`, `alterMfaOnAllUsers`, `changeADPassword`, `changeADSyncPassword`, `deactivateADSync`, `delADOU`, `deleteADAccount`, … |
| `id` | integer | read-only | Task id |
| `status` | msServices.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": "activateADSync",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/msServices/{serviceName}/removeMfaOnAllUsers" \
  -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("/msServices/{serviceName}/removeMfaOnAllUsers")

# 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("/msServices/{serviceName}/removeMfaOnAllUsers");

print_r($result);
?>
```
