# Web Cloud › Internet › Email 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

> 5 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/internet/email/

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

## Operations

- `GET /xdsl/email/pro` — List xDSL Email Pro accounts
- `GET /xdsl/email/pro/{email}` — Get an xDSL Email Pro account
- `PUT /xdsl/email/pro/{email}` — Update an xDSL Email Pro account
- `DELETE /xdsl/email/pro/{email}` — Delete an xDSL Email Pro account
- `POST /xdsl/email/pro/{email}/changePassword` — Change the password of an xDSL Email Pro account

## List xDSL Email Pro accounts

`GET /1.0/xdsl/email/pro`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/email/#get-xdsl-email-pro

**Status:** Stable production version  
**IAM actions:** `xdslEmail:apiovh:get`

Returns the email addresses of the Email Pro accounts provided with the xDSL accesses.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `iamTags` | query | object |  | Filter resources on IAM tags |

### Responses

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

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

### Example

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

# 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("/xdsl/email/pro");

print_r($result);
?>
```

## Get an xDSL Email Pro account

`GET /1.0/xdsl/email/pro/{email}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/email/#get-xdsl-email-pro-email

**Status:** Stable production version  
**IAM actions:** `xdslEmail:apiovh:get`

Returns the login, names, primary address, quota and usage, state and last logon and logoff dates of an Email Pro account.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | xdsl.xdslEmailProWithIAM | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `currentUsage` | complexType.UnitAndValue_double | read-only | Mailbox usage |
| `currentUsage.unit` | string | read-only |  |
| `currentUsage.value` | number | read-only |  |
| `displayName` | string |  | Account display name |
| `domain` | string | read-only | Email domain |
| `firstName` | string |  | Account first name |
| `iam` | iam.ResourceMetadata | read-only | IAM resource metadata |
| `iam.displayName` | string | read-only | Resource display name |
| `iam.id` | string (uuid) | read-only | Unique identifier of the resource |
| `iam.state` | iam.ResourceMetadata.StateEnum | read-only | Resource state — one of `EXPIRED`, `IN_CREATION`, `OK`, `SUSPENDED` |
| `iam.tags` | object | read-only | Resource tags. Tags that were internally computed are prefixed with ovh: |
| `iam.urn` | string | read-only | Unique resource name used in policies |
| `id` | integer | read-only | Account id |
| `initial` | string |  | Account initials |
| `lastLogoffDate` | string (date-time) | read-only | Last logoff |
| `lastLogonDate` | string (date-time) | read-only | Last logon |
| `lastName` | string |  | Account last name |
| `login` | string | read-only | Account login |
| `passwordLastUpdate` | string (date-time) | read-only | Time of account's password last update |
| `primaryEmailAddress` | string | read-only | Default email for this mailbox |
| `quota` | complexType.UnitAndValue_long | read-only | Account maximum size |
| `quota.unit` | string | read-only |  |
| `quota.value` | integer | read-only |  |
| `state` | email.pro.ObjectStateEnum | read-only | Account state — one of `creating`, `deleting`, `ok`, `reopening`, `suspended`, `suspending`, `unknown` |
| `taskPendingId` | integer | read-only | Pending tasks for this account |

```json
{
  "currentUsage": {
    "unit": "string",
    "value": 0
  },
  "displayName": "string",
  "domain": "string",
  "firstName": "string",
  "iam": {
    "displayName": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "state": "EXPIRED",
    "tags": {
      "key": "string"
    },
    "urn": "string"
  },
  "id": 0,
  "initial": "string",
  "lastLogoffDate": "2024-01-01T12:00:00Z",
  "lastLogonDate": "2024-01-01T12:00:00Z",
  "lastName": "string",
  "login": "string",
  "passwordLastUpdate": "2024-01-01T12:00:00Z",
  "primaryEmailAddress": "string",
  "quota": {
    "unit": "string",
    "value": 0
  },
  "state": "creating",
  "taskPendingId": 0
}
```

### Example

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

print_r($result);
?>
```

## Update an xDSL Email Pro account

`PUT /1.0/xdsl/email/pro/{email}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/email/#put-xdsl-email-pro-email

**Status:** Stable production version  
**IAM actions:** `xdslEmail:apiovh:edit`

Changes the first name, last name, initials and display name of the Email Pro account.

### Parameters

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

### Request body (required)

Type: `xdsl.xdslEmailPro`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `currentUsage` | complexType.UnitAndValue_double | read-only | Mailbox usage |
| `currentUsage.unit` | string | read-only |  |
| `currentUsage.value` | number | read-only |  |
| `displayName` | string |  | Account display name |
| `domain` | string | read-only | Email domain |
| `firstName` | string |  | Account first name |
| `id` | integer | read-only | Account id |
| `initial` | string |  | Account initials |
| `lastLogoffDate` | string (date-time) | read-only | Last logoff |
| `lastLogonDate` | string (date-time) | read-only | Last logon |
| `lastName` | string |  | Account last name |
| `login` | string | read-only | Account login |
| `passwordLastUpdate` | string (date-time) | read-only | Time of account's password last update |
| `primaryEmailAddress` | string | read-only | Default email for this mailbox |
| `quota` | complexType.UnitAndValue_long | read-only | Account maximum size |
| `quota.unit` | string | read-only |  |
| `quota.value` | integer | read-only |  |
| `state` | email.pro.ObjectStateEnum | read-only | Account state — one of `creating`, `deleting`, `ok`, `reopening`, `suspended`, `suspending`, `unknown` |
| `taskPendingId` | integer | read-only | Pending tasks for this account |

```json
{
  "displayName": "string",
  "firstName": "string",
  "initial": "string",
  "lastName": "string"
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/xdsl/email/pro/{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: xdsl.xdslEmailPro
result = client.put("/xdsl/email/pro/{email}",
	displayName = None, # Account display name (type: string, nullable)
	firstName = None, # Account first name (type: string, nullable)
	initial = None, # Account initials (type: string, nullable)
	lastName = None, # Account last name (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: xdsl.xdslEmailPro
$result = $ovh->put("/xdsl/email/pro/{email}", array(
	displayName => null, // Account display name (type: string, nullable)
	firstName => null, // Account first name (type: string, nullable)
	initial => null, // Account initials (type: string, nullable)
	lastName => null, // Account last name (type: string, nullable)
));

print_r($result);
?>
```

## Delete an xDSL Email Pro account

`DELETE /1.0/xdsl/email/pro/{email}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/email/#delete-xdsl-email-pro-email

**Status:** Stable production version  
**IAM actions:** `xdslEmail:apiovh:delete`

Deletes the Email Pro account and its mailbox.

### Parameters

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

### Responses

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

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/xdsl/email/pro/{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.delete("/xdsl/email/pro/{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->delete("/xdsl/email/pro/{email}");

print_r($result);
?>
```

## Change the password of an xDSL Email Pro account

`POST /1.0/xdsl/email/pro/{email}/changePassword`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/internet/email/#changeEmailPassword

**Status:** Stable production version  
**IAM actions:** `xdslEmail:apiovh:changePassword`

Sets a new password for the Email Pro account. Returns the task that performs the change.

### Parameters

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

### Request body (required)

Type: `xdsl.email.pro.changePassword.post`

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

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

### Responses

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `finishDate` | string (date-time) | read-only | Finished date of the task |
| `function` | string | read-only | Function of the task |
| `status` | xdsl.email.pro.TaskStatusEnum | read-only | Status of an Email Pro task. — one of `cancelled`, `doing`, `done`, `error`, `todo` |
| `todoDate` | string (date-time) | read-only | Todo date of the task |

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

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/xdsl/email/pro/{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: xdsl.email.pro.changePassword.post
result = client.post("/xdsl/email/pro/{email}/changePassword",
	password = None, # New email password (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: xdsl.email.pro.changePassword.post
$result = $ovh->post("/xdsl/email/pro/{email}/changePassword", array(
	password => null, // New email password (type: string)
));

print_r($result);
?>
```
