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

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

Page: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/zimbra-platform/delegations/

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

## Operations

- `GET /email/mxplan/{service}/account/{email}/fullAccess` — List full access permissions
- `GET /email/mxplan/{service}/account/{email}/fullAccess/{allowedAccountId}` — Get a full access permission
- `POST /email/mxplan/{service}/account/{email}/fullAccess` — Add a full access permission
- `DELETE /email/mxplan/{service}/account/{email}/fullAccess/{allowedAccountId}` — Remove a full access permission
- `GET /email/mxplan/{service}/account/{email}/sendAs` — List send as permissions
- `GET /email/mxplan/{service}/account/{email}/sendAs/{allowedAccountId}` — Get a send as permission
- `POST /email/mxplan/{service}/account/{email}/sendAs` — Add a send as permission
- `DELETE /email/mxplan/{service}/account/{email}/sendAs/{allowedAccountId}` — Remove a send as permission
- `GET /email/mxplan/{service}/account/{email}/sendOnBehalfTo` — List send on behalf permissions
- `GET /email/mxplan/{service}/account/{email}/sendOnBehalfTo/{allowedAccountId}` — Get a send on behalf permission
- `POST /email/mxplan/{service}/account/{email}/sendOnBehalfTo` — Add a send on behalf permission
- `DELETE /email/mxplan/{service}/account/{email}/sendOnBehalfTo/{allowedAccountId}` — Remove a send on behalf permission

## List full access permissions

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

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

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

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

### Parameters

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

### Responses

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

```json
[
  0
]
```

### Example

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

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

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

result = client.get("/email/mxplan/{service}/account/{email}/fullAccess")

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

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

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

$result = $ovh->get("/email/mxplan/{service}/account/{email}/fullAccess");

print_r($result);
?>
```

## Get a full access permission

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

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

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

Get a full access permission. Returns the ID of the account that has full access to the email account, and the creation date of the permission.

### Parameters

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

### Responses

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

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

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

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/mxplan/{service}/account/{email}/fullAccess/{allowedAccountId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

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

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

result = client.get("/email/mxplan/{service}/account/{email}/fullAccess/{allowedAccountId}")

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

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

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

$result = $ovh->get("/email/mxplan/{service}/account/{email}/fullAccess/{allowedAccountId}");

print_r($result);
?>
```

## Add a full access permission

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

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

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

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

### Parameters

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

### Request body (required)

Type: `object`

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

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

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.pro.TaskFunctionEnum | read-only | Function name — one of `addAccount`, `addAlias`, `addDomain`, `addDomainDKIM`, `addDomainDisclaimer`, `addExternalContact`, `addFullAccess`, `addSendAs`, `addSendOnBehalfTo`, `addServiceAuthorizedIp`, `changeHostname`, `changePassword`, … |
| `id` | integer | read-only | Task id |
| `status` | email.pro.TaskStatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Creation date |

```json
{
  "finishDate": "2024-01-01T12:00:00Z",
  "function": "addAccount",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

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

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

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

# Request body type: long
result = client.post("/email/mxplan/{service}/account/{email}/fullAccess",
	allowedAccountId = None, # User to give full access (type: long)
)

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

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

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

// Request body type: long
$result = $ovh->post("/email/mxplan/{service}/account/{email}/fullAccess", array(
	allowedAccountId => null, // User to give full access (type: long)
));

print_r($result);
?>
```

## Remove a full access permission

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

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

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

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

### Parameters

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

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.pro.TaskFunctionEnum | read-only | Function name — one of `addAccount`, `addAlias`, `addDomain`, `addDomainDKIM`, `addDomainDisclaimer`, `addExternalContact`, `addFullAccess`, `addSendAs`, `addSendOnBehalfTo`, `addServiceAuthorizedIp`, `changeHostname`, `changePassword`, … |
| `id` | integer | read-only | Task id |
| `status` | email.pro.TaskStatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Creation date |

```json
{
  "finishDate": "2024-01-01T12:00:00Z",
  "function": "addAccount",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/email/mxplan/{service}/account/{email}/fullAccess/{allowedAccountId}" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

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

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

result = client.delete("/email/mxplan/{service}/account/{email}/fullAccess/{allowedAccountId}")

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

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

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

$result = $ovh->delete("/email/mxplan/{service}/account/{email}/fullAccess/{allowedAccountId}");

print_r($result);
?>
```

## List send as permissions

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

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

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

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

### Parameters

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

### Responses

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

```json
[
  0
]
```

### Example

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

print_r($result);
?>
```

## Get a send as permission

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

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

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

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

### Parameters

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

### Responses

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

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

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

### Example

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

print_r($result);
?>
```

## Add a send as permission

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

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

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

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

### Parameters

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

### Request body (required)

Type: `object`

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

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

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.pro.TaskFunctionEnum | read-only | Function name — one of `addAccount`, `addAlias`, `addDomain`, `addDomainDKIM`, `addDomainDisclaimer`, `addExternalContact`, `addFullAccess`, `addSendAs`, `addSendOnBehalfTo`, `addServiceAuthorizedIp`, `changeHostname`, `changePassword`, … |
| `id` | integer | read-only | Task id |
| `status` | email.pro.TaskStatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Creation date |

```json
{
  "finishDate": "2024-01-01T12:00:00Z",
  "function": "addAccount",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

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

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

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

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

// Request body type: long
$result = $ovh->post("/email/mxplan/{service}/account/{email}/sendAs", array(
	allowAccountId => null, // Account id to allow to send mails from this mailbox (type: long)
));

print_r($result);
?>
```

## Remove a send as permission

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

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

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

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

### Parameters

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

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.pro.TaskFunctionEnum | read-only | Function name — one of `addAccount`, `addAlias`, `addDomain`, `addDomainDKIM`, `addDomainDisclaimer`, `addExternalContact`, `addFullAccess`, `addSendAs`, `addSendOnBehalfTo`, `addServiceAuthorizedIp`, `changeHostname`, `changePassword`, … |
| `id` | integer | read-only | Task id |
| `status` | email.pro.TaskStatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Creation date |

```json
{
  "finishDate": "2024-01-01T12:00:00Z",
  "function": "addAccount",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

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

print_r($result);
?>
```

## List send on behalf permissions

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

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

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

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

### Parameters

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

### Responses

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

```json
[
  0
]
```

### Example

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

print_r($result);
?>
```

## Get a send on behalf permission

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

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

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

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

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.mxplan.AccountSendOnBehalfTo | 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/mxplan/{service}/account/{email}/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/mxplan/{service}/account/{email}/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/mxplan/{service}/account/{email}/sendOnBehalfTo/{allowedAccountId}");

print_r($result);
?>
```

## Add a send on behalf permission

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

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

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

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

### Parameters

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

### Request body (required)

Type: `object`

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

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

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.pro.TaskFunctionEnum | read-only | Function name — one of `addAccount`, `addAlias`, `addDomain`, `addDomainDKIM`, `addDomainDisclaimer`, `addExternalContact`, `addFullAccess`, `addSendAs`, `addSendOnBehalfTo`, `addServiceAuthorizedIp`, `changeHostname`, `changePassword`, … |
| `id` | integer | read-only | Task id |
| `status` | email.pro.TaskStatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Creation date |

```json
{
  "finishDate": "2024-01-01T12:00:00Z",
  "function": "addAccount",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

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

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

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

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

// Request body type: long
$result = $ovh->post("/email/mxplan/{service}/account/{email}/sendOnBehalfTo", array(
	allowAccountId => null, // Account id to allow to send On Behalf To mails from this mailbox (type: long)
));

print_r($result);
?>
```

## Remove a send on behalf permission

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

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

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

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

### Parameters

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

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Completion date |
| `function` | email.pro.TaskFunctionEnum | read-only | Function name — one of `addAccount`, `addAlias`, `addDomain`, `addDomainDKIM`, `addDomainDisclaimer`, `addExternalContact`, `addFullAccess`, `addSendAs`, `addSendOnBehalfTo`, `addServiceAuthorizedIp`, `changeHostname`, `changePassword`, … |
| `id` | integer | read-only | Task id |
| `status` | email.pro.TaskStatusEnum | read-only | Task status — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Creation date |

```json
{
  "finishDate": "2024-01-01T12:00:00Z",
  "function": "addAccount",
  "id": 0,
  "status": "cancelled",
  "todoDate": "2024-01-01T12:00:00Z"
}
```

### Example

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

print_r($result);
?>
```
