# Web Cloud › Email and Collaborative Solutions › MX Plan › Roundcube platform › Delegated Accounts API

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

> 20 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/roundcube-platform/delegated-accounts/

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

## Operations

- `GET /email/domain/delegatedAccount` — List delegated accounts
- `GET /email/domain/delegatedAccount/{email}` — Get a delegated account
- `PUT /email/domain/delegatedAccount/{email}` — Update a delegated account
- `POST /email/domain/delegatedAccount/{email}/changePassword` — Change a delegated account password
- `GET /email/domain/delegatedAccount/{email}/filter` — List filters
- `GET /email/domain/delegatedAccount/{email}/filter/{name}` — Get a filter
- `POST /email/domain/delegatedAccount/{email}/filter` — Create a filter
- `DELETE /email/domain/delegatedAccount/{email}/filter/{name}` — Delete a filter
- `POST /email/domain/delegatedAccount/{email}/filter/{name}/changeActivity` — Enable or disable a filter
- `POST /email/domain/delegatedAccount/{email}/filter/{name}/changePriority` — Change filter priority
- `GET /email/domain/delegatedAccount/{email}/filter/{name}/rule` — List filter rules
- `GET /email/domain/delegatedAccount/{email}/filter/{name}/rule/{id}` — Get a filter rule
- `POST /email/domain/delegatedAccount/{email}/filter/{name}/rule` — Create a filter rule
- `DELETE /email/domain/delegatedAccount/{email}/filter/{name}/rule/{id}` — Delete a filter rule
- `GET /email/domain/delegatedAccount/{email}/responder` — Get a delegated account responder
- `POST /email/domain/delegatedAccount/{email}/responder` — Create a delegated account responder
- `DELETE /email/domain/delegatedAccount/{email}/responder` — Delete a delegated account responder
- `PUT /email/domain/delegatedAccount/{email}/responder` — Update a delegated account responder
- `POST /email/domain/delegatedAccount/{email}/updateUsage` — Refresh delegated account usage
- `POST /email/domain/delegatedAccount/{email}/usage` — Get delegated account usage

## List delegated accounts

`GET /1.0/email/domain/delegatedAccount`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#get-email-domain-delegatedaccount

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

List delegated accounts. Returns the email addresses of the email accounts delegated to the customer account. Filter them by `domain` or `accountName`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountName` | query | string |  | Name of email address |
| `domain` | query | string |  | Domain of email address |

### Responses

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

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

### Example

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

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

print_r($result);
?>
```

## Get a delegated account

`GET /1.0/email/domain/delegatedAccount/{email}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#get-email-domain-delegatedaccount-email

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

Get a delegated account. Returns the email address, description, size in bytes, allowed sizes and blocked state of the delegated email account.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.AccountDelegated | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accountName` | string | read-only | Name of account |
| `allowedAccountSize` | integer[] | read-only | List of allowed sizes for this account in bytes |
| `description` | string |  | Account description |
| `domain` | string | read-only | Name of domain |
| `email` | string | read-only | Email |
| `isBlocked` | boolean | read-only | If true your account is blocked |
| `size` | integer |  | Size of your account in bytes |

```json
{
  "accountName": "string",
  "allowedAccountSize": [
    0
  ],
  "description": "string",
  "domain": "string",
  "email": "string",
  "isBlocked": true,
  "size": 0
}
```

### Example

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

# 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/domain/delegatedAccount/{email}");

print_r($result);
?>
```

## Update a delegated account

`PUT /1.0/email/domain/delegatedAccount/{email}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#put-email-domain-delegatedaccount-email

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

Update a delegated account. Updates the description or the size in bytes of the delegated email account. The allowed sizes are in `allowedAccountSize`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email |

### Request body (required)

Type: `email.domain.AccountDelegated`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accountName` | string | read-only | Name of account |
| `allowedAccountSize` | integer[] | read-only | List of allowed sizes for this account in bytes |
| `description` | string |  | Account description |
| `domain` | string | read-only | Name of domain |
| `email` | string | read-only | Email |
| `isBlocked` | boolean | read-only | If true your account is blocked |
| `size` | integer |  | Size of your account in bytes |

```json
{
  "description": "string",
  "size": 0
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/email/domain/delegatedAccount/{email}" \
  -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.domain.AccountDelegated
result = client.put("/email/domain/delegatedAccount/{email}",
	description = None, # Account description (type: string)
	size = None, # Size of your account in bytes (type: integer)
)

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

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

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

// Request body type: email.domain.AccountDelegated
$result = $ovh->put("/email/domain/delegatedAccount/{email}", array(
	description => null, // Account description (type: string)
	size => null, // Size of your account in bytes (type: integer)
));

print_r($result);
?>
```

## Change a delegated account password

`POST /1.0/email/domain/delegatedAccount/{email}/changePassword`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#post-email-domain-delegatedaccount-email-changepassword

**Status:** Stable production version  
**IAM actions:** `emailDomain:apiovh:delegatedAccount/changePassword`

Change a delegated account password. Sets a new password and returns the task. The password needs 8 to 30 characters and no accents.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email |

### Request body (required)

Type: `object`

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

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.TaskPop | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | domain.DomainPopActionEnum | read-only | Action of task — one of `addAccount`, `changeAccount`, `changePassword`, `deleteAccount`, `internalMigration`, `migration`, `temporaryTask`, `unknown` |
| `date` | string (date-time) | read-only | Creation date of task |
| `domain` | string | read-only | Domain name of task |
| `id` | integer | read-only | Id of task |
| `name` | string | read-only | Account name of task |

```json
{
  "action": "addAccount",
  "date": "2024-01-01T12:00:00Z",
  "domain": "string",
  "id": 0,
  "name": "string"
}
```

### Example

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

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

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

# Request body type: password
result = client.post("/email/domain/delegatedAccount/{email}/changePassword",
	password = None, # New password (type: password)
)

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

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

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

// Request body type: password
$result = $ovh->post("/email/domain/delegatedAccount/{email}/changePassword", array(
	password => null, // New password (type: password)
));

print_r($result);
?>
```

## List filters

`GET /1.0/email/domain/delegatedAccount/{email}/filter`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#get-email-domain-delegatedaccount-email-filter

**Status:** Stable production version  
**IAM actions:** `emailDomain:apiovh:delegatedAccount/filter/get`

List filters. Returns the names of the filters of the delegated email account. Get one to read its action, priority and state.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email |

### Responses

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

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

### Example

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

# 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/domain/delegatedAccount/{email}/filter");

print_r($result);
?>
```

## Get a filter

`GET /1.0/email/domain/delegatedAccount/{email}/filter/{name}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#get-email-domain-delegatedaccount-email-filter-name

**Status:** Stable production version  
**IAM actions:** `emailDomain:apiovh:delegatedAccount/filter/get`

Get a filter. Returns the account, priority, active state, action (accept, account, delete or redirect) and action parameter of the filter.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email |
| `name` | path | string | yes | Filter name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.Filter | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | domain.DomainFilterActionEnum | read-only | Action of filter — one of `accept`, `account`, `delete`, `redirect` |
| `actionParam` | string | read-only | Action parameter of filter |
| `active` | boolean | read-only | If true filter is active |
| `domain` | string | read-only | Domain name of filter |
| `name` | string | read-only | Filter name |
| `pop` | string | read-only | Account name of filter |
| `priority` | integer | read-only | Priority of filter |

```json
{
  "action": "accept",
  "actionParam": "string",
  "active": true,
  "domain": "string",
  "name": "string",
  "pop": "string",
  "priority": 0
}
```

### Example

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

# 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/domain/delegatedAccount/{email}/filter/{name}");

print_r($result);
?>
```

## Create a filter

`POST /1.0/email/domain/delegatedAccount/{email}/filter`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#post-email-domain-delegatedaccount-email-filter

**Status:** Stable production version  
**IAM actions:** `emailDomain:apiovh:delegatedAccount/filter/create`

Create a filter. Creates a filter with a rule on a `header` (`operand` and `value`), an `action`, a `priority` and an `active` state, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `action` | domain.DomainFilterActionEnum | yes | Action of filter — one of `accept`, `account`, `delete`, `redirect` |
| `actionParam` | string |  | Action parameter of filter |
| `active` | boolean | yes | If true filter is active |
| `header` | string | yes | Header to be filtered |
| `name` | string | yes | Filter name |
| `operand` | domain.DomainFilterOperandEnum | yes | Rule of filter — one of `checkspf`, `contains`, `noContains` |
| `priority` | integer | yes | Priority of filter |
| `value` | string | yes | Rule parameter of filter |

```json
{
  "action": "accept",
  "actionParam": "string",
  "active": true,
  "header": "string",
  "name": "string",
  "operand": "checkspf",
  "priority": 0,
  "value": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.TaskFilter | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `account` | string | read-only | Account name of task |
| `action` | string | read-only | Action of task |
| `domain` | string | read-only | Domain name of task |
| `id` | integer | read-only | Id of task |
| `timestamp` | string (date-time) | read-only | Creation date of task |

```json
{
  "account": "string",
  "action": "string",
  "domain": "string",
  "id": 0,
  "timestamp": "2024-01-01T12:00:00Z"
}
```

### Example

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

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

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

result = client.post("/email/domain/delegatedAccount/{email}/filter",
	action = None, # Action of filter (type: domain.DomainFilterActionEnum)
	actionParam = None, # Action parameter of filter (type: string, nullable)
	active = None, # If true filter is active (type: boolean)
	header = None, # Header to be filtered (type: string)
	name = None, # Filter name (type: string)
	operand = None, # Rule of filter (type: domain.DomainFilterOperandEnum)
	priority = None, # Priority of filter (type: long)
	value = None, # Rule parameter of filter (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

$result = $ovh->post("/email/domain/delegatedAccount/{email}/filter", array(
	action => null, // Action of filter (type: domain.DomainFilterActionEnum)
	actionParam => null, // Action parameter of filter (type: string, nullable)
	active => null, // If true filter is active (type: boolean)
	header => null, // Header to be filtered (type: string)
	name => null, // Filter name (type: string)
	operand => null, // Rule of filter (type: domain.DomainFilterOperandEnum)
	priority => null, // Priority of filter (type: long)
	value => null, // Rule parameter of filter (type: string)
));

print_r($result);
?>
```

## Delete a filter

`DELETE /1.0/email/domain/delegatedAccount/{email}/filter/{name}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#delete-email-domain-delegatedaccount-email-filter-name

**Status:** Stable production version  
**IAM actions:** `emailDomain:apiovh:delegatedAccount/filter/delete`

Delete a filter. Removes the filter and its rules from the email account, and returns the tasks. Incoming emails are no longer filtered by it.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email |
| `name` | path | string | yes | Filter name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.TaskFilter[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `account` | string | read-only | Account name of task |
| `action` | string | read-only | Action of task |
| `domain` | string | read-only | Domain name of task |
| `id` | integer | read-only | Id of task |
| `timestamp` | string (date-time) | read-only | Creation date of task |

```json
[
  {
    "account": "string",
    "action": "string",
    "domain": "string",
    "id": 0,
    "timestamp": "2024-01-01T12:00:00Z"
  }
]
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/email/domain/delegatedAccount/{email}/filter/{name}" \
  -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/domain/delegatedAccount/{email}/filter/{name}")

# 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/domain/delegatedAccount/{email}/filter/{name}");

print_r($result);
?>
```

## Enable or disable a filter

`POST /1.0/email/domain/delegatedAccount/{email}/filter/{name}/changeActivity`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#post-email-domain-delegatedaccount-email-filter-name-changeactivity

**Status:** Stable production version  
**IAM actions:** `emailDomain:apiovh:delegatedAccount/filter/changeActivity`

Enable or disable a filter. Set `activity` to true to apply the filter to incoming emails, or to false to suspend it.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email |
| `name` | path | string | yes | Filter name |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `activity` | boolean | yes | New activity |

```json
{
  "activity": true
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.TaskFilter | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `account` | string | read-only | Account name of task |
| `action` | string | read-only | Action of task |
| `domain` | string | read-only | Domain name of task |
| `id` | integer | read-only | Id of task |
| `timestamp` | string (date-time) | read-only | Creation date of task |

```json
{
  "account": "string",
  "action": "string",
  "domain": "string",
  "id": 0,
  "timestamp": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/domain/delegatedAccount/{email}/filter/{name}/changeActivity" \
  -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/domain/delegatedAccount/{email}/filter/{name}/changeActivity",
	activity = None, # New activity (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: boolean
$result = $ovh->post("/email/domain/delegatedAccount/{email}/filter/{name}/changeActivity", array(
	activity => null, // New activity (type: boolean)
));

print_r($result);
?>
```

## Change filter priority

`POST /1.0/email/domain/delegatedAccount/{email}/filter/{name}/changePriority`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#post-email-domain-delegatedaccount-email-filter-name-changepriority

**Status:** Stable production version  
**IAM actions:** `emailDomain:apiovh:delegatedAccount/filter/changePriority`

Change filter priority. Sets the `priority` of the filter, which gives the order the filters of the account are applied in.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email |
| `name` | path | string | yes | Filter name |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `priority` | integer | yes | New priority |

```json
{
  "priority": 0
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.TaskFilter | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `account` | string | read-only | Account name of task |
| `action` | string | read-only | Action of task |
| `domain` | string | read-only | Domain name of task |
| `id` | integer | read-only | Id of task |
| `timestamp` | string (date-time) | read-only | Creation date of task |

```json
{
  "account": "string",
  "action": "string",
  "domain": "string",
  "id": 0,
  "timestamp": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/domain/delegatedAccount/{email}/filter/{name}/changePriority" \
  -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/domain/delegatedAccount/{email}/filter/{name}/changePriority",
	priority = None, # New priority (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/domain/delegatedAccount/{email}/filter/{name}/changePriority", array(
	priority => null, // New priority (type: long)
));

print_r($result);
?>
```

## List filter rules

`GET /1.0/email/domain/delegatedAccount/{email}/filter/{name}/rule`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#get-email-domain-delegatedaccount-email-filter-name-rule

**Status:** Stable production version  
**IAM actions:** `emailDomain:apiovh:delegatedAccount/filter/rule/get`

List filter rules. Returns the IDs of the rules of the filter. Get one to read the header it checks, its operand and its value.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email |
| `name` | path | string | yes | Filter name |

### Responses

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

```json
[
  0
]
```

### Example

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

# 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/domain/delegatedAccount/{email}/filter/{name}/rule");

print_r($result);
?>
```

## Get a filter rule

`GET /1.0/email/domain/delegatedAccount/{email}/filter/{name}/rule/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#get-email-domain-delegatedaccount-email-filter-name-rule-id

**Status:** Stable production version  
**IAM actions:** `emailDomain:apiovh:delegatedAccount/filter/rule/get`

Get a filter rule. Returns the header, the operand (checkspf, contains or noContains) and the value of the rule.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email |
| `id` | path | integer | yes |  |
| `name` | path | string | yes | Filter name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.Rule | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `header` | string | read-only | Header to be filtered |
| `id` | integer | read-only |  |
| `operand` | domain.DomainFilterOperandEnum | read-only | Rule of filter — one of `checkspf`, `contains`, `noContains` |
| `value` | string | read-only | Rule parameter of filter |

```json
{
  "header": "string",
  "id": 0,
  "operand": "checkspf",
  "value": "string"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/email/domain/delegatedAccount/{email}/filter/{name}/rule/{id}" \
  -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/domain/delegatedAccount/{email}/filter/{name}/rule/{id}")

# 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/domain/delegatedAccount/{email}/filter/{name}/rule/{id}");

print_r($result);
?>
```

## Create a filter rule

`POST /1.0/email/domain/delegatedAccount/{email}/filter/{name}/rule`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#post-email-domain-delegatedaccount-email-filter-name-rule

**Status:** Stable production version  
**IAM actions:** `emailDomain:apiovh:delegatedAccount/filter/rule/create`

Create a filter rule. Adds a rule to the filter on a `header`, with an `operand` (checkspf, contains or noContains) and a `value`, and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email |
| `name` | path | string | yes | Filter name |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `header` | string | yes | Header to be filtered |
| `operand` | domain.DomainFilterOperandEnum | yes | Rule of filter — one of `checkspf`, `contains`, `noContains` |
| `value` | string | yes | Rule parameter of filter |

```json
{
  "header": "string",
  "operand": "checkspf",
  "value": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.TaskFilter | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `account` | string | read-only | Account name of task |
| `action` | string | read-only | Action of task |
| `domain` | string | read-only | Domain name of task |
| `id` | integer | read-only | Id of task |
| `timestamp` | string (date-time) | read-only | Creation date of task |

```json
{
  "account": "string",
  "action": "string",
  "domain": "string",
  "id": 0,
  "timestamp": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/domain/delegatedAccount/{email}/filter/{name}/rule" \
  -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/domain/delegatedAccount/{email}/filter/{name}/rule",
	header = None, # Header to be filtered (type: string)
	operand = None, # Rule of filter (type: domain.DomainFilterOperandEnum)
	value = None, # Rule parameter of filter (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/domain/delegatedAccount/{email}/filter/{name}/rule", array(
	header => null, // Header to be filtered (type: string)
	operand => null, // Rule of filter (type: domain.DomainFilterOperandEnum)
	value => null, // Rule parameter of filter (type: string)
));

print_r($result);
?>
```

## Delete a filter rule

`DELETE /1.0/email/domain/delegatedAccount/{email}/filter/{name}/rule/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#delete-email-domain-delegatedaccount-email-filter-name-rule-id

**Status:** Stable production version  
**IAM actions:** `emailDomain:apiovh:delegatedAccount/filter/rule/delete`

Delete a filter rule. Removes the rule from the filter and returns the tasks. The filter keeps applying its other rules.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email |
| `id` | path | integer | yes |  |
| `name` | path | string | yes | Filter name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.TaskFilter[] | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `account` | string | read-only | Account name of task |
| `action` | string | read-only | Action of task |
| `domain` | string | read-only | Domain name of task |
| `id` | integer | read-only | Id of task |
| `timestamp` | string (date-time) | read-only | Creation date of task |

```json
[
  {
    "account": "string",
    "action": "string",
    "domain": "string",
    "id": 0,
    "timestamp": "2024-01-01T12:00:00Z"
  }
]
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/email/domain/delegatedAccount/{email}/filter/{name}/rule/{id}" \
  -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/domain/delegatedAccount/{email}/filter/{name}/rule/{id}")

# 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/domain/delegatedAccount/{email}/filter/{name}/rule/{id}");

print_r($result);
?>
```

## Get a delegated account responder

`GET /1.0/email/domain/delegatedAccount/{email}/responder`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#get-email-domain-delegatedaccount-email-responder

**Status:** Stable production version  
**IAM actions:** `account:apiovh:emailDomain/delegatedAccount/responder/get`

Get a delegated account responder. Returns the content, the start and end dates and the copy settings of the responder of the delegated email account.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.ResponderAccount | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `account` | string | read-only | Name of account |
| `content` | string |  | Content of responder |
| `copy` | boolean | read-only | If true, emails will be copy to emailToCopy address |
| `copyTo` | string | read-only | Account where copy emails |
| `from` | string (date-time) |  | Date of start responder |
| `to` | string (date-time) |  | Date of end responder |

```json
{
  "account": "string",
  "content": "string",
  "copy": true,
  "copyTo": "string",
  "from": "2024-01-01T12:00:00Z",
  "to": "2024-01-01T12:00:00Z"
}
```

### Example

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

# 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/domain/delegatedAccount/{email}/responder");

print_r($result);
?>
```

## Create a delegated account responder

`POST /1.0/email/domain/delegatedAccount/{email}/responder`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#post-email-domain-delegatedaccount-email-responder

**Status:** Stable production version  
**IAM actions:** `account:apiovh:emailDomain/delegatedAccount/responder/create`

Create a delegated account responder. Creates the automatic reply of the delegated email account with its content and optional start and end dates, and returns the task. Set `copy` to true to copy the emails to `copyTo`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email |

### Request body (required)

Type: `object`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `content` | string | yes | Content of responder |
| `copy` | boolean | yes | If true, emails will be copy to emailToCopy address |
| `copyTo` | string |  | Account where copy emails |
| `from` | string (date-time) |  | Date of start responder |
| `to` | string (date-time) |  | Date of end responder |

```json
{
  "content": "string",
  "copy": true,
  "copyTo": "string",
  "from": "2024-01-01T12:00:00Z",
  "to": "2024-01-01T12:00:00Z"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.TaskSpecialAccount | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `account` | string | read-only | Account name of task |
| `action` | domain.DomainSpecialAccountActionEnum | read-only | Action of task — one of `add`, `change`, `delete` |
| `date` | string (date-time) | read-only | Creation date of task |
| `domain` | string | read-only | Domain name of task |
| `id` | integer | read-only | Id of task |
| `type` | domain.DomainSpecialAccountTypeEnum | read-only | Type of action filter — one of `25g`, `alias`, `delete`, `filter`, `forward`, `responder` |

```json
{
  "account": "string",
  "action": "add",
  "date": "2024-01-01T12:00:00Z",
  "domain": "string",
  "id": 0,
  "type": "25g"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/domain/delegatedAccount/{email}/responder" \
  -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: datetime
result = client.post("/email/domain/delegatedAccount/{email}/responder",
	content = None, # Content of responder (type: string)
	copy = None, # If true, emails will be copy to emailToCopy address (type: boolean)
	copyTo = None, # Account where copy emails (type: string, nullable)
	from = None, # Date of start responder (type: datetime, nullable)
	to = None, # Date of end responder (type: datetime, 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: datetime
$result = $ovh->post("/email/domain/delegatedAccount/{email}/responder", array(
	content => null, // Content of responder (type: string)
	copy => null, // If true, emails will be copy to emailToCopy address (type: boolean)
	copyTo => null, // Account where copy emails (type: string, nullable)
	from => null, // Date of start responder (type: datetime, nullable)
	to => null, // Date of end responder (type: datetime, nullable)
));

print_r($result);
?>
```

## Delete a delegated account responder

`DELETE /1.0/email/domain/delegatedAccount/{email}/responder`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#delete-email-domain-delegatedaccount-email-responder

**Status:** Stable production version  
**IAM actions:** `account:apiovh:emailDomain/delegatedAccount/responder/delete`

Delete a delegated account responder. Removes the automatic reply of the delegated email account and returns the task.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | email.domain.TaskSpecialAccount | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `account` | string | read-only | Account name of task |
| `action` | domain.DomainSpecialAccountActionEnum | read-only | Action of task — one of `add`, `change`, `delete` |
| `date` | string (date-time) | read-only | Creation date of task |
| `domain` | string | read-only | Domain name of task |
| `id` | integer | read-only | Id of task |
| `type` | domain.DomainSpecialAccountTypeEnum | read-only | Type of action filter — one of `25g`, `alias`, `delete`, `filter`, `forward`, `responder` |

```json
{
  "account": "string",
  "action": "add",
  "date": "2024-01-01T12:00:00Z",
  "domain": "string",
  "id": 0,
  "type": "25g"
}
```

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/email/domain/delegatedAccount/{email}/responder" \
  -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/domain/delegatedAccount/{email}/responder")

# 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/domain/delegatedAccount/{email}/responder");

print_r($result);
?>
```

## Update a delegated account responder

`PUT /1.0/email/domain/delegatedAccount/{email}/responder`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#put-email-domain-delegatedaccount-email-responder

**Status:** Stable production version  
**IAM actions:** `account:apiovh:emailDomain/delegatedAccount/responder/edit`

Update a delegated account responder. Updates the content and the start and end dates of the responder.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email |

### Request body (required)

Type: `email.domain.ResponderAccount`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `account` | string | read-only | Name of account |
| `content` | string |  | Content of responder |
| `copy` | boolean | read-only | If true, emails will be copy to emailToCopy address |
| `copyTo` | string | read-only | Account where copy emails |
| `from` | string (date-time) |  | Date of start responder |
| `to` | string (date-time) |  | Date of end responder |

```json
{
  "content": "string",
  "from": "2024-01-01T12:00:00Z",
  "to": "2024-01-01T12:00:00Z"
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/email/domain/delegatedAccount/{email}/responder" \
  -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.domain.ResponderAccount
result = client.put("/email/domain/delegatedAccount/{email}/responder",
	content = None, # Content of responder (type: string)
	from = None, # Date of start responder (type: string, nullable)
	to = None, # Date of end responder (type: string, nullable)
)

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

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

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

// Request body type: email.domain.ResponderAccount
$result = $ovh->put("/email/domain/delegatedAccount/{email}/responder", array(
	content => null, // Content of responder (type: string)
	from => null, // Date of start responder (type: string, nullable)
	to => null, // Date of end responder (type: string, nullable)
));

print_r($result);
?>
```

## Refresh delegated account usage

`POST /1.0/email/domain/delegatedAccount/{email}/updateUsage`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#post-email-domain-delegatedaccount-email-updateusage

**Status:** Stable production version  
**IAM actions:** `account:apiovh:emailDomain/delegatedAccount/updateUsage`

Refresh delegated account usage. Asks for the figures returned by `usage` to be recomputed; they are updated asynchronously.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email |

### Responses

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

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/domain/delegatedAccount/{email}/updateUsage" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

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

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

result = client.post("/email/domain/delegatedAccount/{email}/updateUsage")

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

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

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

$result = $ovh->post("/email/domain/delegatedAccount/{email}/updateUsage");

print_r($result);
?>
```

## Get delegated account usage

`POST /1.0/email/domain/delegatedAccount/{email}/usage`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/email-and-collaborative-solutions/mx-plan/roundcube-platform/delegated-accounts/#post-email-domain-delegatedaccount-email-usage

**Status:** Stable production version  
**IAM actions:** `account:apiovh:emailDomain/delegatedAccount/usage/create`

Get delegated account usage. Returns the number of emails, the maximum size in bytes of the mailbox (`quota`) and the date of the measure.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `email` | path | string | yes | Email |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | domain.DomainUsageAccountStruct | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `date` | string (date-time) |  | Timestamp |
| `emailCount` | integer |  | Number of message in mailbox |
| `quota` | integer |  | Size of mailbox (bytes) |

```json
{
  "date": "2024-01-01T12:00:00Z",
  "emailCount": 0,
  "quota": 0
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/email/domain/delegatedAccount/{email}/usage" \
  -H "accept: application/json" \
  -H "authorization: Bearer $OVH_TOKEN"
```

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

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

result = client.post("/email/domain/delegatedAccount/{email}/usage")

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

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

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

$result = $ovh->post("/email/domain/delegatedAccount/{email}/usage");

print_r($result);
?>
```
