# Web Cloud › Domains › DNS zones › DynHost 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

> 11 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/domains/dns-zones/dynhost/

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

## Operations

- `GET /domain/zone/{zoneName}/dynHost/login` — List DynHost logins
- `GET /domain/zone/{zoneName}/dynHost/login/{login}` — Get a DynHost login
- `POST /domain/zone/{zoneName}/dynHost/login` — Create a DynHost login
- `PUT /domain/zone/{zoneName}/dynHost/login/{login}` — Update a DynHost login
- `DELETE /domain/zone/{zoneName}/dynHost/login/{login}` — Delete a DynHost login
- `POST /domain/zone/{zoneName}/dynHost/login/{login}/changePassword` — Change a DynHost password
- `GET /domain/zone/{zoneName}/dynHost/record` — List DynHost records
- `GET /domain/zone/{zoneName}/dynHost/record/{id}` — Get a DynHost record
- `POST /domain/zone/{zoneName}/dynHost/record` — Create a DynHost record
- `PUT /domain/zone/{zoneName}/dynHost/record/{id}` — Update a DynHost record
- `DELETE /domain/zone/{zoneName}/dynHost/record/{id}` — Delete a DynHost record

## List DynHost logins

`GET /1.0/domain/zone/{zoneName}/dynHost/login`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/domains/dns-zones/dynhost/#getDynHostLogins

**Status:** Stable production version  
**IAM actions:** `dnsZone:apiovh:dynHost/login/get`

Returns the DynHost logins of the zone. Can be filtered by login and subdomain.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `login` | query | string |  | Filter the value of login property (ilike) |
| `subDomain` | query | string |  | Filter the value of subDomain property (ilike) |
| `zoneName` | path | string | yes | Zone name |

### Responses

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

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

### Example

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

# 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("/domain/zone/{zoneName}/dynHost/login");

print_r($result);
?>
```

## Get a DynHost login

`GET /1.0/domain/zone/{zoneName}/dynHost/login/{login}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/domains/dns-zones/dynhost/#getDynHostLogin

**Status:** Stable production version  
**IAM actions:** `dnsZone:apiovh:dynHost/login/get`

Returns a DynHost login: its name and the subdomain it can update.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `login` | path | string | yes | Login |
| `zoneName` | path | string | yes | Zone name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | domain.zone.dynHost.Login | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `login` | string | read-only | Login name |
| `subDomain` | string |  | Login sub-domain |
| `zone` | string | read-only | Login zone |

```json
{
  "login": "string",
  "subDomain": "string",
  "zone": "string"
}
```

### Example

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

# 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("/domain/zone/{zoneName}/dynHost/login/{login}");

print_r($result);
?>
```

## Create a DynHost login

`POST /1.0/domain/zone/{zoneName}/dynHost/login`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/domains/dns-zones/dynhost/#createDynDnsLogin

**Status:** Stable production version  
**IAM actions:** `dnsZone:apiovh:dynHost/login/create`

Creates a login named from the zone name and a suffix. The subdomain `*` allows all subdomains.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `zoneName` | path | string | yes | Zone name |

### Request body (required)

Type: `domain.zone.dynHost.LoginCreate`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `loginSuffix` | string | yes | Suffix that will be concatenated to the zoneName to create the login |
| `password` | string (password) | yes | Password of the login |
| `subDomain` | string | yes | Subdomain that the login will be allowed to update (use * to allow all) |

```json
{
  "loginSuffix": "string",
  "password": "string",
  "subDomain": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | domain.zone.dynHost.Login | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `login` | string | read-only | Login name |
| `subDomain` | string |  | Login sub-domain |
| `zone` | string | read-only | Login zone |

```json
{
  "login": "string",
  "subDomain": "string",
  "zone": "string"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/domain/zone/{zoneName}/dynHost/login" \
  -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: domain.zone.dynHost.LoginCreate
result = client.post("/domain/zone/{zoneName}/dynHost/login",
	loginSuffix = None, # Suffix that will be concatenated to the zoneName to create the login (type: string)
	password = None, # Password of the login (type: string)
	subDomain = None, # Subdomain that the login will be allowed to update (use * to allow all) (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: domain.zone.dynHost.LoginCreate
$result = $ovh->post("/domain/zone/{zoneName}/dynHost/login", array(
	loginSuffix => null, // Suffix that will be concatenated to the zoneName to create the login (type: string)
	password => null, // Password of the login (type: string)
	subDomain => null, // Subdomain that the login will be allowed to update (use * to allow all) (type: string)
));

print_r($result);
?>
```

## Update a DynHost login

`PUT /1.0/domain/zone/{zoneName}/dynHost/login/{login}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/domains/dns-zones/dynhost/#editDynDnsLogin

**Status:** Stable production version  
**IAM actions:** `dnsZone:apiovh:dynHost/login/edit`

Updates the subdomain a DynHost login is allowed to update.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `login` | path | string | yes | Login |
| `zoneName` | path | string | yes | Zone name |

### Request body (required)

Type: `domain.zone.dynHost.Login`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `login` | string | read-only | Login name |
| `subDomain` | string |  | Login sub-domain |
| `zone` | string | read-only | Login zone |

```json
{
  "subDomain": "string"
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/domain/zone/{zoneName}/dynHost/login/{login}" \
  -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: domain.zone.dynHost.Login
result = client.put("/domain/zone/{zoneName}/dynHost/login/{login}",
	subDomain = None, # Login sub-domain (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: domain.zone.dynHost.Login
$result = $ovh->put("/domain/zone/{zoneName}/dynHost/login/{login}", array(
	subDomain => null, // Login sub-domain (type: string)
));

print_r($result);
?>
```

## Delete a DynHost login

`DELETE /1.0/domain/zone/{zoneName}/dynHost/login/{login}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/domains/dns-zones/dynhost/#deleteDynHostLogin

**Status:** Stable production version  
**IAM actions:** `dnsZone:apiovh:dynHost/login/delete`

Deletes a DynHost login from the zone.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `login` | path | string | yes | Login |
| `zoneName` | path | string | yes | Zone name |

### Responses

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

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/domain/zone/{zoneName}/dynHost/login/{login}" \
  -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("/domain/zone/{zoneName}/dynHost/login/{login}")

# 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("/domain/zone/{zoneName}/dynHost/login/{login}");

print_r($result);
?>
```

## Change a DynHost password

`POST /1.0/domain/zone/{zoneName}/dynHost/login/{login}/changePassword`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/domains/dns-zones/dynhost/#changePasswordDynDnsLogin

**Status:** Stable production version  
**IAM actions:** `dnsZone:apiovh:dynHost/login/changePassword`

Sets a new password for a DynHost login.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `login` | path | string | yes | Login |
| `zoneName` | path | string | yes | Zone name |

### Request body (required)

Type: `domain.zone.dynHost.LoginChangePassword`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `password` | string (password) | yes | New password of the DynHost login |

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

### Responses

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

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/domain/zone/{zoneName}/dynHost/login/{login}/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: domain.zone.dynHost.LoginChangePassword
result = client.post("/domain/zone/{zoneName}/dynHost/login/{login}/changePassword",
	password = None, # New password of the DynHost login (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: domain.zone.dynHost.LoginChangePassword
$result = $ovh->post("/domain/zone/{zoneName}/dynHost/login/{login}/changePassword", array(
	password => null, // New password of the DynHost login (type: string)
));

print_r($result);
?>
```

## List DynHost records

`GET /1.0/domain/zone/{zoneName}/dynHost/record`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/domains/dns-zones/dynhost/#getDynHostRecords

**Status:** Stable production version  
**IAM actions:** `dnsZone:apiovh:dynHost/record/get`

Returns the identifiers of the DynHost records of the zone. Can be filtered by subdomain.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `subDomain` | query | string |  | Filter the value of subDomain property (ilike) |
| `zoneName` | path | string | yes | Zone name |

### Responses

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

```json
[
  0
]
```

### Example

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

# 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("/domain/zone/{zoneName}/dynHost/record");

print_r($result);
?>
```

## Get a DynHost record

`GET /1.0/domain/zone/{zoneName}/dynHost/record/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/domains/dns-zones/dynhost/#getDynHostRecord

**Status:** Stable production version  
**IAM actions:** `dnsZone:apiovh:dynHost/record/get`

Returns a DynHost record: subdomain, IP and TTL.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | Id |
| `zoneName` | path | string | yes | Zone name |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | domain.zone.dynHost.Record | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer | read-only | Record ID |
| `ip` | ip |  | Record IP |
| `subDomain` | string |  | Record sub-domain |
| `ttl` | integer | read-only | Record TTL (Time to Live) |
| `zone` | string | read-only | Record zone |

```json
{
  "id": 0,
  "ip": "192.0.2.0",
  "subDomain": "string",
  "ttl": 0,
  "zone": "string"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/1.0/domain/zone/{zoneName}/dynHost/record/{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("/domain/zone/{zoneName}/dynHost/record/{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("/domain/zone/{zoneName}/dynHost/record/{id}");

print_r($result);
?>
```

## Create a DynHost record

`POST /1.0/domain/zone/{zoneName}/dynHost/record`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/domains/dns-zones/dynhost/#createDynDnsRecord

**Status:** Stable production version  
**IAM actions:** `dnsZone:apiovh:dynHost/record/create`

Creates a DynHost record with a subdomain, an IP and a TTL.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `zoneName` | path | string | yes | Zone name |

### Request body (required)

Type: `domain.zone.dynHost.Record`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer | read-only | Record ID |
| `ip` | ip |  | Record IP |
| `subDomain` | string |  | Record sub-domain |
| `ttl` | integer | read-only | Record TTL (Time to Live) |
| `zone` | string | read-only | Record zone |

```json
{
  "ip": "192.0.2.0",
  "subDomain": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | domain.zone.dynHost.Record | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer | read-only | Record ID |
| `ip` | ip |  | Record IP |
| `subDomain` | string |  | Record sub-domain |
| `ttl` | integer | read-only | Record TTL (Time to Live) |
| `zone` | string | read-only | Record zone |

```json
{
  "id": 0,
  "ip": "192.0.2.0",
  "subDomain": "string",
  "ttl": 0,
  "zone": "string"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/domain/zone/{zoneName}/dynHost/record" \
  -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: domain.zone.dynHost.Record
result = client.post("/domain/zone/{zoneName}/dynHost/record",
	ip = None, # Record IP (type: ip)
	subDomain = None, # Record sub-domain (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: domain.zone.dynHost.Record
$result = $ovh->post("/domain/zone/{zoneName}/dynHost/record", array(
	ip => null, // Record IP (type: ip)
	subDomain => null, // Record sub-domain (type: string, nullable)
));

print_r($result);
?>
```

## Update a DynHost record

`PUT /1.0/domain/zone/{zoneName}/dynHost/record/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/domains/dns-zones/dynhost/#editDynDnsRecord

**Status:** Stable production version  
**IAM actions:** `dnsZone:apiovh:dynHost/record/edit`

Updates the IP and TTL of a DynHost record.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | Id |
| `zoneName` | path | string | yes | Zone name |

### Request body (required)

Type: `domain.zone.dynHost.Record`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer | read-only | Record ID |
| `ip` | ip |  | Record IP |
| `subDomain` | string |  | Record sub-domain |
| `ttl` | integer | read-only | Record TTL (Time to Live) |
| `zone` | string | read-only | Record zone |

```json
{
  "ip": "192.0.2.0",
  "subDomain": "string"
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/domain/zone/{zoneName}/dynHost/record/{id}" \
  -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: domain.zone.dynHost.Record
result = client.put("/domain/zone/{zoneName}/dynHost/record/{id}",
	ip = None, # Record IP (type: ip)
	subDomain = None, # Record sub-domain (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: domain.zone.dynHost.Record
$result = $ovh->put("/domain/zone/{zoneName}/dynHost/record/{id}", array(
	ip => null, // Record IP (type: ip)
	subDomain => null, // Record sub-domain (type: string, nullable)
));

print_r($result);
?>
```

## Delete a DynHost record

`DELETE /1.0/domain/zone/{zoneName}/dynHost/record/{id}`

Link: https://developers.eu.ovhcloud.com/reference/web-cloud/domains/dns-zones/dynhost/#deleteDynHostRecord

**Status:** Stable production version  
**IAM actions:** `dnsZone:apiovh:dynHost/record/delete`

Deletes a DynHost record.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | integer | yes | Id |
| `zoneName` | path | string | yes | Zone name |

### Responses

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

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/1.0/domain/zone/{zoneName}/dynHost/record/{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("/domain/zone/{zoneName}/dynHost/record/{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("/domain/zone/{zoneName}/dynHost/record/{id}");

print_r($result);
?>
```
