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

> 33 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/trusted-exchange/groups/

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

## Operations

- `GET /email/exchange/{organizationName}/service/{exchangeService}/mailingList` — List groups
- `GET /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}` — Get a group
- `POST /email/exchange/{organizationName}/service/{exchangeService}/mailingList` — Create a group
- `DELETE /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}` — Delete a group
- `PUT /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}` — Update a group
- `GET /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/alias` — List group aliases
- `GET /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/alias/{alias}` — Get a group alias
- `POST /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/alias` — Create a group alias
- `DELETE /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/alias/{alias}` — Delete a group alias
- `GET /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/manager/account` — List group managers
- `GET /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/manager/account/{managerAccountId}` — Get a group manager
- `POST /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/manager/account` — Add a group manager
- `DELETE /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/manager/account/{managerAccountId}` — Remove a group manager
- `GET /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/account` — List account members
- `GET /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/account/{memberAccountId}` — Get a group member
- `POST /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/account` — Add a group member
- `DELETE /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/account/{memberAccountId}` — Remove a group member
- `GET /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/contact` — List contact members
- `GET /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/contact/{memberContactId}` — Get a group member
- `POST /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/contact` — Add a group member
- `DELETE /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/contact/{memberContactId}` — Remove a group member
- `GET /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/mailingList` — List group members
- `GET /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/mailingList/{memberMailingListId}` — Get a group member
- `POST /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/mailingList` — Add a group member
- `DELETE /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/mailingList/{memberMailingListId}` — Remove a group member
- `GET /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/sendAs` — List send as permissions
- `GET /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/sendAs/{allowedAccountId}` — Get a send as permission
- `POST /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/sendAs` — Add a send as permission
- `DELETE /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/sendAs/{allowedAccountId}` — Remove a send as permission
- `GET /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/sendOnBehalfTo` — List send on behalf permissions
- `GET /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/sendOnBehalfTo/{allowedAccountId}` — Get a send on behalf permission
- `POST /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/sendOnBehalfTo` — Add a send on behalf permission
- `DELETE /email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/sendOnBehalfTo/{allowedAccountId}` — Remove a send on behalf permission

## List groups

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

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

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

List groups. Returns the email addresses of the groups (distribution lists) of the service. Filter them by `mailingListAddress` or `company`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `company` | query | string |  | Filter the value of company property (like) |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `mailingListAddress` | query | string |  | Filter the value of mailingListAddress property (like) |
| `organizationName` | path | string | yes | The internal name of your exchange organization |

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

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

print_r($result);
?>
```

## Get a group

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#get-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress

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

Get a group. Returns the address, display name, join and depart restrictions, size limits, sender authentication and state of the group.

### Parameters

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

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `company` | string |  | Company name |
| `creationDate` | string (date-time) | read-only | Creation date |
| `departRestriction` | email.exchange.MailingListDepartRestrictionEnum |  | Depart restriction policy — one of `closed`, `open` |
| `displayName` | string |  | Name displayed in Global Access List |
| `hiddenFromGAL` | boolean |  | If true mailing list is hiddend in Global Address List |
| `id` | integer | read-only | Mailing list id |
| `joinRestriction` | email.exchange.MailingListJoinRestrictionEnum |  | Join restriction policy — one of `approvalRequired`, `closed`, `open` |
| `lastUpdateDate` | string (date-time) | read-only | Update date |
| `mailingListAddress` | string |  | The mailing list address |
| `maxReceiveSize` | integer |  | Maximum receive email size in MB |
| `maxSendSize` | integer |  | Maximum send email size in MB |
| `senderAuthentification` | boolean |  | If true sender has to authenticate |
| `spamDetected` | boolean | read-only | Account was sending spam |
| `spamTicketNumber` | integer | read-only | Ticket number of spam detection |
| `state` | email.exchange.ObjectStateEnum | read-only | Mailing list state — one of `creating`, `deleting`, `internalMigration`, `ok`, `reopening`, `suspended`, `suspending` |
| `taskPendingId` | integer | read-only | Task pending id |

```json
{
  "company": "string",
  "creationDate": "2024-01-01T12:00:00Z",
  "departRestriction": "closed",
  "displayName": "string",
  "hiddenFromGAL": true,
  "id": 0,
  "joinRestriction": "approvalRequired",
  "lastUpdateDate": "2024-01-01T12:00:00Z",
  "mailingListAddress": "string",
  "maxReceiveSize": 0,
  "maxSendSize": 0,
  "senderAuthentification": true,
  "spamDetected": true,
  "spamTicketNumber": 0,
  "state": "creating",
  "taskPendingId": 0
}
```

### Example

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

# 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}/mailingList/{mailingListAddress}");

print_r($result);
?>
```

## Create a group

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

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

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

Create a group. Creates a group from its `mailingListAddress` and its join and depart restrictions, 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 |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `company` | string |  | Company name |
| `departRestriction` | email.exchange.MailingListDepartRestrictionEnum | yes | Depart restriction policy — one of `closed`, `open` |
| `displayName` | string |  | Name displayed in Global Access List |
| `hiddenFromGAL` | boolean |  | If true mailing list is hiddend in Global Address List |
| `joinRestriction` | email.exchange.MailingListJoinRestrictionEnum | yes | Join restriction policy — one of `approvalRequired`, `closed`, `open` |
| `mailingListAddress` | string | yes | The mailing list address |
| `maxReceiveSize` | integer |  | Maximum receive email size in MB |
| `maxSendSize` | integer |  | Maximum send email size in MB |
| `senderAuthentification` | boolean |  | If true sender has to authenticate |

```json
{
  "company": "string",
  "departRestriction": "closed",
  "displayName": "string",
  "hiddenFromGAL": true,
  "joinRestriction": "approvalRequired",
  "mailingListAddress": "string",
  "maxReceiveSize": 0,
  "maxSendSize": 0,
  "senderAuthentification": true
}
```

### 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}/mailingList" \
  -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: boolean
result = client.post("/email/exchange/{organizationName}/service/{exchangeService}/mailingList",
	company = None, # Company name (type: string, nullable)
	departRestriction = None, # Depart restriction policy (type: email.exchange.MailingListDepartRestrictionEnum)
	displayName = None, # Name displayed in Global Access List (type: string, nullable)
	hiddenFromGAL = None, # If true mailing list is hiddend in Global Address List (type: boolean, nullable)
	joinRestriction = None, # Join restriction policy (type: email.exchange.MailingListJoinRestrictionEnum)
	mailingListAddress = None, # The mailing list address (type: string)
	maxReceiveSize = None, # Maximum receive email size in MB (type: long, nullable)
	maxSendSize = None, # Maximum send email size in MB (type: long, nullable)
	senderAuthentification = None, # If true sender has to authenticate (type: boolean, 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: boolean
$result = $ovh->post("/email/exchange/{organizationName}/service/{exchangeService}/mailingList", array(
	company => null, // Company name (type: string, nullable)
	departRestriction => null, // Depart restriction policy (type: email.exchange.MailingListDepartRestrictionEnum)
	displayName => null, // Name displayed in Global Access List (type: string, nullable)
	hiddenFromGAL => null, // If true mailing list is hiddend in Global Address List (type: boolean, nullable)
	joinRestriction => null, // Join restriction policy (type: email.exchange.MailingListJoinRestrictionEnum)
	mailingListAddress => null, // The mailing list address (type: string)
	maxReceiveSize => null, // Maximum receive email size in MB (type: long, nullable)
	maxSendSize => null, // Maximum send email size in MB (type: long, nullable)
	senderAuthentification => null, // If true sender has to authenticate (type: boolean, nullable)
));

print_r($result);
?>
```

## Delete a group

`DELETE /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#delete-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress

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

Delete a group. Deletes the group with its aliases and permissions, and returns the task. Its members keep their own accounts.

### Parameters

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

### 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}/mailingList/{mailingListAddress}" \
  -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}/mailingList/{mailingListAddress}")

# 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}/mailingList/{mailingListAddress}");

print_r($result);
?>
```

## Update a group

`PUT /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#put-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress

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

Update a group. Updates the address, display name, join and depart restrictions, size limits, sender authentication and Global Address List visibility of the group.

### Parameters

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

### Request body (required)

Type: `email.exchange.mailingList`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `company` | string |  | Company name |
| `creationDate` | string (date-time) | read-only | Creation date |
| `departRestriction` | email.exchange.MailingListDepartRestrictionEnum |  | Depart restriction policy — one of `closed`, `open` |
| `displayName` | string |  | Name displayed in Global Access List |
| `hiddenFromGAL` | boolean |  | If true mailing list is hiddend in Global Address List |
| `id` | integer | read-only | Mailing list id |
| `joinRestriction` | email.exchange.MailingListJoinRestrictionEnum |  | Join restriction policy — one of `approvalRequired`, `closed`, `open` |
| `lastUpdateDate` | string (date-time) | read-only | Update date |
| `mailingListAddress` | string |  | The mailing list address |
| `maxReceiveSize` | integer |  | Maximum receive email size in MB |
| `maxSendSize` | integer |  | Maximum send email size in MB |
| `senderAuthentification` | boolean |  | If true sender has to authenticate |
| `spamDetected` | boolean | read-only | Account was sending spam |
| `spamTicketNumber` | integer | read-only | Ticket number of spam detection |
| `state` | email.exchange.ObjectStateEnum | read-only | Mailing list state — one of `creating`, `deleting`, `internalMigration`, `ok`, `reopening`, `suspended`, `suspending` |
| `taskPendingId` | integer | read-only | Task pending id |

```json
{
  "company": "string",
  "departRestriction": "closed",
  "displayName": "string",
  "hiddenFromGAL": true,
  "joinRestriction": "approvalRequired",
  "mailingListAddress": "string",
  "maxReceiveSize": 0,
  "maxSendSize": 0,
  "senderAuthentification": 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}/mailingList/{mailingListAddress}" \
  -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.mailingList
result = client.put("/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}",
	company = None, # Company name (type: string, nullable)
	departRestriction = None, # Depart restriction policy (type: email.exchange.MailingListDepartRestrictionEnum)
	displayName = None, # Name displayed in Global Access List (type: string, nullable)
	hiddenFromGAL = None, # If true mailing list is hiddend in Global Address List (type: boolean)
	joinRestriction = None, # Join restriction policy (type: email.exchange.MailingListJoinRestrictionEnum)
	mailingListAddress = None, # The mailing list address (type: string)
	maxReceiveSize = None, # Maximum receive email size in MB (type: integer, nullable)
	maxSendSize = None, # Maximum send email size in MB (type: integer, nullable)
	senderAuthentification = None, # If true sender has to authenticate (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.mailingList
$result = $ovh->put("/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}", array(
	company => null, // Company name (type: string, nullable)
	departRestriction => null, // Depart restriction policy (type: email.exchange.MailingListDepartRestrictionEnum)
	displayName => null, // Name displayed in Global Access List (type: string, nullable)
	hiddenFromGAL => null, // If true mailing list is hiddend in Global Address List (type: boolean)
	joinRestriction => null, // Join restriction policy (type: email.exchange.MailingListJoinRestrictionEnum)
	mailingListAddress => null, // The mailing list address (type: string)
	maxReceiveSize => null, // Maximum receive email size in MB (type: integer, nullable)
	maxSendSize => null, // Maximum send email size in MB (type: integer, nullable)
	senderAuthentification => null, // If true sender has to authenticate (type: boolean)
));

print_r($result);
?>
```

## List group aliases

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/alias`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#get-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-alias

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

List group aliases. Returns the aliases of the group: extra addresses that deliver to the members of the group.

### Parameters

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

### 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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/alias");

print_r($result);
?>
```

## Get a group alias

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/alias/{alias}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#get-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-alias-alias

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

Get a group 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 |
| `mailingListAddress` | path | string | yes | The mailing list address |
| `organizationName` | path | string | yes | The internal name of your exchange organization |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.exchangeMailingListAlias | 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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/alias/{alias}");

print_r($result);
?>
```

## Create a group alias

`POST /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/alias`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#post-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-alias

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

Create a group alias. Adds the `alias` address to the group, so that the emails sent to it reach the members, and returns the task.

### Parameters

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

### 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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/alias", array(
	alias => null, // Alias (type: string)
));

print_r($result);
?>
```

## Delete a group alias

`DELETE /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/alias/{alias}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#delete-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-alias-alias

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

Delete a group alias. Removes the alias address from the group, whose members no longer receive 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 |
| `mailingListAddress` | path | string | yes | The mailing list address |
| `organizationName` | path | string | yes | The internal name of your exchange organization |

### 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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/alias/{alias}");

print_r($result);
?>
```

## List group managers

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

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#get-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-manager-account

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

List group managers. Returns the IDs of the email accounts that manage the group: they can change its members and settings.

### Parameters

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

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

print_r($result);
?>
```

## Get a group manager

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/manager/account/{managerAccountId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#get-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-manager-account-manageraccountid

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

Get a group manager. Returns the ID and the email address of the account that manages the group, and the date it was added.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `mailingListAddress` | path | string | yes | The mailing list address |
| `managerAccountId` | path | integer | yes | Manager account id |
| `organizationName` | path | string | yes | The internal name of your exchange organization |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creationDate` | string (date-time) | read-only | Creation date |
| `managerAccountId` | integer | read-only | Manager account id |
| `managerEmailAddress` | string | read-only | Member account primaryEmailAddress |
| `taskPendingId` | integer | read-only | Pending task id |

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

### Example

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

# 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}/mailingList/{mailingListAddress}/manager/account/{managerAccountId}");

print_r($result);
?>
```

## Add a group manager

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

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#post-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-manager-account

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

Add a group manager. Makes the email account given by `managerAccountId` a manager of the group, and returns the task.

### Parameters

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

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `managerAccountId` | integer | yes | Manager account id |

```json
{
  "managerAccountId": 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}/mailingList/{mailingListAddress}/manager/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: long
result = client.post("/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/manager/account",
	managerAccountId = None, # Manager account id (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}/mailingList/{mailingListAddress}/manager/account", array(
	managerAccountId => null, // Manager account id (type: long)
));

print_r($result);
?>
```

## Remove a group manager

`DELETE /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/manager/account/{managerAccountId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#delete-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-manager-account-manageraccountid

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

Remove a group manager. Withdraws from the email account the management of the group, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `mailingListAddress` | path | string | yes | The mailing list address |
| `managerAccountId` | path | integer | yes | Manager account id |
| `organizationName` | path | string | yes | The internal name of your exchange organization |

### 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}/mailingList/{mailingListAddress}/manager/account/{managerAccountId}" \
  -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}/mailingList/{mailingListAddress}/manager/account/{managerAccountId}")

# 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}/mailingList/{mailingListAddress}/manager/account/{managerAccountId}");

print_r($result);
?>
```

## List account members

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

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#get-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-member-account

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

List account members. Returns the IDs of the email accounts that are members of the group. External contacts are listed under `member/contact`.

### Parameters

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

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

print_r($result);
?>
```

## Get a group member

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/account/{memberAccountId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#get-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-member-account-memberaccountid

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

Get a group member. Returns the email address and the ID of the member (account, contact or group), and the date it was added.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `mailingListAddress` | path | string | yes | The mailing list address |
| `memberAccountId` | path | integer | yes | Member account id |
| `organizationName` | path | string | yes | The internal name of your exchange organization |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creationDate` | string (date-time) | read-only | Creation date |
| `memberAccountId` | integer | read-only | Member account id |
| `memberContactId` | integer | read-only | Member account id |
| `memberEmailAddress` | string | read-only | Member account primaryEmailAddress |
| `memberMailingListId` | integer | read-only | Member mailing list id |
| `taskPendingId` | integer | read-only | Pending task id |

```json
{
  "creationDate": "2024-01-01T12:00:00Z",
  "memberAccountId": 0,
  "memberContactId": 0,
  "memberEmailAddress": "string",
  "memberMailingListId": 0,
  "taskPendingId": 0
}
```

### Example

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

# 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}/mailingList/{mailingListAddress}/member/account/{memberAccountId}");

print_r($result);
?>
```

## Add a group member

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

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#post-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-member-account

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

Add a group member. Adds a member to the group and returns the task: an email account (`memberAccountId`) through `member/account`, an external contact (`memberContactId`) through `member/contact`, or a group (`memberMailingListId`) through `member/mailingList`.

### Parameters

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

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `memberAccountId` | integer |  | Member account id |
| `memberContactId` | integer |  | Member contact id |
| `memberMailingListId` | integer |  | Member mailing list id |

```json
{
  "memberAccountId": 0,
  "memberContactId": 0,
  "memberMailingListId": 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}/mailingList/{mailingListAddress}/member/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: long
result = client.post("/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/account",
	memberAccountId = None, # Member account id (type: long, nullable)
	memberContactId = None, # Member contact id (type: long, nullable)
	memberMailingListId = None, # Member mailing list id (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}/mailingList/{mailingListAddress}/member/account", array(
	memberAccountId => null, // Member account id (type: long, nullable)
	memberContactId => null, // Member contact id (type: long, nullable)
	memberMailingListId => null, // Member mailing list id (type: long, nullable)
));

print_r($result);
?>
```

## Remove a group member

`DELETE /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/account/{memberAccountId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#delete-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-member-account-memberaccountid

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

Remove a group member. Removes the account, contact or group from the members of the group, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `mailingListAddress` | path | string | yes | The mailing list address |
| `memberAccountId` | path | integer | yes | Member account id |
| `organizationName` | path | string | yes | The internal name of your exchange organization |

### 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}/mailingList/{mailingListAddress}/member/account/{memberAccountId}" \
  -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}/mailingList/{mailingListAddress}/member/account/{memberAccountId}")

# 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}/mailingList/{mailingListAddress}/member/account/{memberAccountId}");

print_r($result);
?>
```

## List contact members

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/contact`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#get-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-member-contact

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/mailingList/member/contact/get`

List contact members. Returns the IDs of the external contacts that are members of the group. Email accounts are listed under `member/account`.

### Parameters

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

### 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}/mailingList/{mailingListAddress}/member/contact" \
  -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}/mailingList/{mailingListAddress}/member/contact")

# 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}/mailingList/{mailingListAddress}/member/contact");

print_r($result);
?>
```

## Get a group member

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/contact/{memberContactId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#get-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-member-contact-membercontactid

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/mailingList/member/contact/get`

Get a group member. Returns the email address and the ID of the member (account, contact or group), and the date it was added.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `mailingListAddress` | path | string | yes | The mailing list address |
| `memberContactId` | path | integer | yes | Member account id |
| `organizationName` | path | string | yes | The internal name of your exchange organization |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creationDate` | string (date-time) | read-only | Creation date |
| `memberAccountId` | integer | read-only | Member account id |
| `memberContactId` | integer | read-only | Member account id |
| `memberEmailAddress` | string | read-only | Member account primaryEmailAddress |
| `memberMailingListId` | integer | read-only | Member mailing list id |
| `taskPendingId` | integer | read-only | Pending task id |

```json
{
  "creationDate": "2024-01-01T12:00:00Z",
  "memberAccountId": 0,
  "memberContactId": 0,
  "memberEmailAddress": "string",
  "memberMailingListId": 0,
  "taskPendingId": 0
}
```

### Example

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

# 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}/mailingList/{mailingListAddress}/member/contact/{memberContactId}");

print_r($result);
?>
```

## Add a group member

`POST /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/contact`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#post-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-member-contact

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/mailingList/member/contact/create`

Add a group member. Adds a member to the group and returns the task: an email account (`memberAccountId`) through `member/account`, an external contact (`memberContactId`) through `member/contact`, or a group (`memberMailingListId`) through `member/mailingList`.

### Parameters

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

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `memberAccountId` | integer |  | Member account id |
| `memberContactId` | integer |  | Member contact id |
| `memberMailingListId` | integer |  | Member mailing list id |

```json
{
  "memberAccountId": 0,
  "memberContactId": 0,
  "memberMailingListId": 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}/mailingList/{mailingListAddress}/member/contact" \
  -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}/mailingList/{mailingListAddress}/member/contact",
	memberAccountId = None, # Member account id (type: long, nullable)
	memberContactId = None, # Member contact id (type: long, nullable)
	memberMailingListId = None, # Member mailing list id (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}/mailingList/{mailingListAddress}/member/contact", array(
	memberAccountId => null, // Member account id (type: long, nullable)
	memberContactId => null, // Member contact id (type: long, nullable)
	memberMailingListId => null, // Member mailing list id (type: long, nullable)
));

print_r($result);
?>
```

## Remove a group member

`DELETE /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/contact/{memberContactId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#delete-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-member-contact-membercontactid

**Status:** Stable production version  
**IAM actions:** `emailExchange:apiovh:service/mailingList/member/contact/delete`

Remove a group member. Removes the account, contact or group from the members of the group, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `mailingListAddress` | path | string | yes | The mailing list address |
| `memberContactId` | path | integer | yes | Member account id |
| `organizationName` | path | string | yes | The internal name of your exchange organization |

### 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}/mailingList/{mailingListAddress}/member/contact/{memberContactId}" \
  -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}/mailingList/{mailingListAddress}/member/contact/{memberContactId}")

# 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}/mailingList/{mailingListAddress}/member/contact/{memberContactId}");

print_r($result);
?>
```

## List group members

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/mailingList`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#get-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-member-mailinglist

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

List group members. Returns the IDs of the groups that are members of the group. Email accounts and external contacts are listed under `member/account` and `member/contact`.

### Parameters

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

### 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}/mailingList/{mailingListAddress}/member/mailingList" \
  -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}/mailingList/{mailingListAddress}/member/mailingList")

# 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}/mailingList/{mailingListAddress}/member/mailingList");

print_r($result);
?>
```

## Get a group member

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/mailingList/{memberMailingListId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#get-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-member-mailinglist-membermailinglistid

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

Get a group member. Returns the email address and the ID of the member (account, contact or group), and the date it was added.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `mailingListAddress` | path | string | yes | The mailing list address |
| `memberMailingListId` | path | integer | yes | Member mailing list id |
| `organizationName` | path | string | yes | The internal name of your exchange organization |

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `creationDate` | string (date-time) | read-only | Creation date |
| `memberAccountId` | integer | read-only | Member account id |
| `memberContactId` | integer | read-only | Member account id |
| `memberEmailAddress` | string | read-only | Member account primaryEmailAddress |
| `memberMailingListId` | integer | read-only | Member mailing list id |
| `taskPendingId` | integer | read-only | Pending task id |

```json
{
  "creationDate": "2024-01-01T12:00:00Z",
  "memberAccountId": 0,
  "memberContactId": 0,
  "memberEmailAddress": "string",
  "memberMailingListId": 0,
  "taskPendingId": 0
}
```

### Example

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

# 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}/mailingList/{mailingListAddress}/member/mailingList/{memberMailingListId}");

print_r($result);
?>
```

## Add a group member

`POST /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/mailingList`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#post-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-member-mailinglist

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

Add a group member. Adds a member to the group and returns the task: an email account (`memberAccountId`) through `member/account`, an external contact (`memberContactId`) through `member/contact`, or a group (`memberMailingListId`) through `member/mailingList`.

### Parameters

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

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `memberAccountId` | integer |  | Member account id |
| `memberContactId` | integer |  | Member contact id |
| `memberMailingListId` | integer |  | Member mailing list id |

```json
{
  "memberAccountId": 0,
  "memberContactId": 0,
  "memberMailingListId": 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}/mailingList/{mailingListAddress}/member/mailingList" \
  -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}/mailingList/{mailingListAddress}/member/mailingList",
	memberAccountId = None, # Member account id (type: long, nullable)
	memberContactId = None, # Member contact id (type: long, nullable)
	memberMailingListId = None, # Member mailing list id (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}/mailingList/{mailingListAddress}/member/mailingList", array(
	memberAccountId => null, // Member account id (type: long, nullable)
	memberContactId => null, // Member contact id (type: long, nullable)
	memberMailingListId => null, // Member mailing list id (type: long, nullable)
));

print_r($result);
?>
```

## Remove a group member

`DELETE /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/member/mailingList/{memberMailingListId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#delete-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-member-mailinglist-membermailinglistid

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

Remove a group member. Removes the account, contact or group from the members of the group, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `exchangeService` | path | string | yes | The internal name of your exchange service |
| `mailingListAddress` | path | string | yes | The mailing list address |
| `memberMailingListId` | path | integer | yes | Member mailing list id |
| `organizationName` | path | string | yes | The internal name of your exchange organization |

### 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}/mailingList/{mailingListAddress}/member/mailingList/{memberMailingListId}" \
  -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}/mailingList/{mailingListAddress}/member/mailingList/{memberMailingListId}")

# 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}/mailingList/{mailingListAddress}/member/mailingList/{memberMailingListId}");

print_r($result);
?>
```

## List send as permissions

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/sendAs`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#get-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-sendas

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

List send as permissions. Returns the IDs of the accounts allowed to send emails as the group, from the group address.

### Parameters

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

### 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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/sendAs");

print_r($result);
?>
```

## Get a send as permission

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/sendAs/{allowedAccountId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#get-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-sendas-allowedaccountid

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

Get a send as permission. Returns the ID of the account allowed to send emails as this group, 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 |
| `mailingListAddress` | path | string | yes | The mailing list address |
| `organizationName` | path | string | yes | The internal name of your exchange organization |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.exchangeDistributionGroupSendAs | 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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/sendAs/{allowedAccountId}");

print_r($result);
?>
```

## Add a send as permission

`POST /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/sendAs`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#post-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-sendas

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

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

### Parameters

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

### Request body (required)

Type: `object`

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

```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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/sendAs",
	allowAccountId = None, # Account id to allow to send as mails from this mailing list (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}/mailingList/{mailingListAddress}/sendAs", array(
	allowAccountId => null, // Account id to allow to send as mails from this mailing list (type: long)
));

print_r($result);
?>
```

## Remove a send as permission

`DELETE /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/sendAs/{allowedAccountId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#delete-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-sendas-allowedaccountid

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

Remove a send as permission. Withdraws the right of the allowed account to send emails as this group, 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 |
| `mailingListAddress` | path | string | yes | The mailing list address |
| `organizationName` | path | string | yes | The internal name of your exchange organization |

### 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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/sendAs/{allowedAccountId}");

print_r($result);
?>
```

## List send on behalf permissions

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/sendOnBehalfTo`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#get-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-sendonbehalfto

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

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

### Parameters

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

### 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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/sendOnBehalfTo");

print_r($result);
?>
```

## Get a send on behalf permission

`GET /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/sendOnBehalfTo/{allowedAccountId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#get-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-sendonbehalfto-allowedaccountid

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

Get a send on behalf permission. Returns the ID of the account allowed to send emails on behalf of this group, 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 |
| `mailingListAddress` | path | string | yes | The mailing list address |
| `organizationName` | path | string | yes | The internal name of your exchange organization |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.exchange.exchangeDistributionGroupSendOnBehalfTo | 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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/sendOnBehalfTo/{allowedAccountId}");

print_r($result);
?>
```

## Add a send on behalf permission

`POST /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/sendOnBehalfTo`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#post-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-sendonbehalfto

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

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

### Parameters

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

### Request body (required)

Type: `object`

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

```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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/sendOnBehalfTo",
	allowAccountId = None, # Account id to allow to send as mails from this mailing list (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}/mailingList/{mailingListAddress}/sendOnBehalfTo", array(
	allowAccountId => null, // Account id to allow to send as mails from this mailing list (type: long)
));

print_r($result);
?>
```

## Remove a send on behalf permission

`DELETE /1.0/email/exchange/{organizationName}/service/{exchangeService}/mailingList/{mailingListAddress}/sendOnBehalfTo/{allowedAccountId}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/microsoft-exchange/trusted-exchange/groups/#delete-email-exchange-organizationname-service-exchangeservice-mailinglist-mailinglistaddress-sendonbehalfto-allowedaccountid

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

Remove a send on behalf permission. Withdraws the right of the allowed account to send emails on behalf of this group, 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 |
| `mailingListAddress` | path | string | yes | The mailing list address |
| `organizationName` | path | string | yes | The internal name of your exchange organization |

### 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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/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}/mailingList/{mailingListAddress}/sendOnBehalfTo/{allowedAccountId}");

print_r($result);
?>
```
