# Network › DNS › Subscription API

> Part of the OVHcloud developer hub. Index of every page and section: https://developers.eu.ovhcloud.com/llms.txt
> The Network product's sections: https://developers.eu.ovhcloud.com/reference/network/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/network/dns/subscription/

OpenAPI v1: https://api.eu.ovhcloud.com/1.0/__schemas/developer-hub-navigation/network/dns/subscription.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/network/dns/subscription.json?format=openapi3

## Operations

- `GET /domain/zone/{zoneName}/serviceInfos` — Get subscription
- `PUT /domain/zone/{zoneName}/serviceInfos` — Update renewal settings
- `POST /domain/zone/{zoneName}/changeContact` — Change contacts
- `POST /domain/zone/{zoneName}/terminate` — Request termination
- `POST /domain/zone/{zoneName}/confirmTermination` — Confirm termination

## Get subscription

`GET /1.0/domain/zone/{zoneName}/serviceInfos`

Link: https://developers.eu.ovhcloud.com/reference/network/dns/subscription/#get-domain-zone-zonename-serviceinfos

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

Returns contacts, creation and expiration dates, and renewal settings.

### Parameters

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

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | services.Service | successful operation |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `canDeleteAtExpiration` | boolean | read-only | Indicates that the service can be set up to be deleted at expiration |
| `contactAdmin` | string | read-only |  |
| `contactBilling` | string | read-only |  |
| `contactTech` | string | read-only |  |
| `creation` | string (date) | read-only |  |
| `domain` | string | read-only |  |
| `engagedUpTo` | string (date) | read-only |  |
| `expiration` | string (date) | read-only |  |
| `possibleRenewPeriod` | integer[] | read-only | All the possible renew period of your service in month |
| `renew` | service.RenewType |  | Way of handling the renew |
| `renew.automatic` | boolean |  | The service is automatically renewed |
| `renew.deleteAtExpiration` | boolean |  | The service will be deleted at expiration |
| `renew.forced` | boolean |  | The service forced to be renewed |
| `renew.manualPayment` | boolean |  | The service needs to be manually renewed and paid |
| `renew.period` | integer |  | period of renew in month |
| `renewalType` | service.RenewalTypeEnum | read-only | Detailed renewal type of a service — one of `automaticForcedProduct`, `automaticV2012`, `automaticV2014`, `automaticV2016`, `manual`, `oneShot`, `option` |
| `serviceId` | integer | read-only |  |
| `status` | service.StateEnum | read-only | service.StateEnum — one of `autorenewInProgress`, `expired`, `inCreation`, `ok`, `pendingDebt`, `unPaid` |

```json
{
  "canDeleteAtExpiration": true,
  "contactAdmin": "string",
  "contactBilling": "string",
  "contactTech": "string",
  "creation": "2024-01-01",
  "domain": "string",
  "engagedUpTo": "2024-01-01",
  "expiration": "2024-01-01",
  "possibleRenewPeriod": [
    0
  ],
  "renew": {
    "automatic": true,
    "deleteAtExpiration": true,
    "forced": true,
    "manualPayment": true,
    "period": 0
  },
  "renewalType": "automaticForcedProduct",
  "serviceId": 0,
  "status": "autorenewInProgress"
}
```

### Example

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

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

print_r($result);
?>
```

## Update renewal settings

`PUT /1.0/domain/zone/{zoneName}/serviceInfos`

Link: https://developers.eu.ovhcloud.com/reference/network/dns/subscription/#put-domain-zone-zonename-serviceinfos

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

Changes how the service renews; `renew` is the only editable field.

### Parameters

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

### Request body (required)

Type: `services.Service`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `canDeleteAtExpiration` | boolean | read-only | Indicates that the service can be set up to be deleted at expiration |
| `contactAdmin` | string | read-only |  |
| `contactBilling` | string | read-only |  |
| `contactTech` | string | read-only |  |
| `creation` | string (date) | read-only |  |
| `domain` | string | read-only |  |
| `engagedUpTo` | string (date) | read-only |  |
| `expiration` | string (date) | read-only |  |
| `possibleRenewPeriod` | integer[] | read-only | All the possible renew period of your service in month |
| `renew` | service.RenewType |  | Way of handling the renew |
| `renew.automatic` | boolean |  | The service is automatically renewed |
| `renew.deleteAtExpiration` | boolean |  | The service will be deleted at expiration |
| `renew.forced` | boolean |  | The service forced to be renewed |
| `renew.manualPayment` | boolean |  | The service needs to be manually renewed and paid |
| `renew.period` | integer |  | period of renew in month |
| `renewalType` | service.RenewalTypeEnum | read-only | Detailed renewal type of a service — one of `automaticForcedProduct`, `automaticV2012`, `automaticV2014`, `automaticV2016`, `manual`, `oneShot`, `option` |
| `serviceId` | integer | read-only |  |
| `status` | service.StateEnum | read-only | service.StateEnum — one of `autorenewInProgress`, `expired`, `inCreation`, `ok`, `pendingDebt`, `unPaid` |

```json
{
  "renew": {
    "automatic": true,
    "deleteAtExpiration": true,
    "forced": true,
    "manualPayment": true,
    "period": 0
  }
}
```

### Responses

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

### Example

```bash
curl -X PUT \
  "https://api.eu.ovhcloud.com/1.0/domain/zone/{zoneName}/serviceInfos" \
  -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: services.Service
result = client.put("/domain/zone/{zoneName}/serviceInfos",
	renew = None, # Way of handling the renew (type: service.RenewType, 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: services.Service
$result = $ovh->put("/domain/zone/{zoneName}/serviceInfos", array(
	renew => null, // Way of handling the renew (type: service.RenewType, nullable)
));

print_r($result);
?>
```

## Change contacts

`POST /1.0/domain/zone/{zoneName}/changeContact`

Link: https://developers.eu.ovhcloud.com/reference/network/dns/subscription/#post-domain-zone-zonename-changecontact

**Status:** Stable production version  
**IAM actions:** `dnsZone:apiovh:changeContact`

Starts the change of the admin, tech or billing contact and returns the request IDs.

### Parameters

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

### Request body (required)

Type: `services.changeContact`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `contactAdmin` | string |  | The contact to set as admin contact |
| `contactBilling` | string |  | The contact to set as billing contact |
| `contactTech` | string |  | The contact to set as tech contact |

```json
{
  "contactAdmin": "string",
  "contactBilling": "string",
  "contactTech": "string"
}
```

### Responses

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

```json
[
  0
]
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/domain/zone/{zoneName}/changeContact" \
  -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: services.changeContact
result = client.post("/domain/zone/{zoneName}/changeContact",
	contactAdmin = None, # The contact to set as admin contact (type: string)
	contactBilling = None, # The contact to set as billing contact (type: string)
	contactTech = None, # The contact to set as tech contact (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: services.changeContact
$result = $ovh->post("/domain/zone/{zoneName}/changeContact", array(
	contactAdmin => null, // The contact to set as admin contact (type: string)
	contactBilling => null, // The contact to set as billing contact (type: string)
	contactTech => null, // The contact to set as tech contact (type: string)
));

print_r($result);
?>
```

## Request termination

`POST /1.0/domain/zone/{zoneName}/terminate`

Link: https://developers.eu.ovhcloud.com/reference/network/dns/subscription/#post-domain-zone-zonename-terminate

**Status:** Stable production version  
**IAM actions:** `dnsZone:apiovh:terminate`

Emails a termination token to the admin contact, to use with *Confirm termination*.

### Parameters

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

### Responses

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

```json
"string"
```

### Example

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

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

print_r($result);
?>
```

## Confirm termination

`POST /1.0/domain/zone/{zoneName}/confirmTermination`

Link: https://developers.eu.ovhcloud.com/reference/network/dns/subscription/#post-domain-zone-zonename-confirmtermination

**Status:** Stable production version  
**IAM actions:** `dnsZone:apiovh:confirmTermination`

Confirms the termination with the token sent by email. The reason and comments are optional.

### Parameters

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

### Request body (required)

Type: `services.confirmTermination`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `commentary` | string |  | Commentary about your termination request |
| `commentaryFutureUse` | string |  | Commentary about your future use |
| `commentaryReason` | string |  | Commentary about your reason for termination request |
| `futureUse` | service.TerminationFutureUseEnum |  | All future uses you can provide for a service termination — one of `NOT_REPLACING_SERVICE`, `OTHER`, `SUBSCRIBE_AN_OTHER_SERVICE`, `SUBSCRIBE_OTHER_KIND_OF_SERVICE_WITH_COMPETITOR`, `SUBSCRIBE_SIMILAR_SERVICE_WITH_COMPETITOR` |
| `reason` | service.TerminationReasonEnum |  | All reasons you can provide for a service termination — one of `FEATURES_DONT_SUIT_ME`, `LACK_OF_PERFORMANCES`, `MIGRATED_TO_ANOTHER_OVH_PRODUCT`, `MIGRATED_TO_COMPETITOR`, `NOT_ENOUGH_RECOGNITION`, `NOT_NEEDED_ANYMORE`, `NOT_RELIABLE`, `NO_ANSWER`, `OTHER`, `PRODUCT_DIMENSION_DONT_SUIT_ME`, `PRODUCT_TOOLS_DONT_SUIT_ME`, `TOO_EXPENSIVE`, … |
| `token` | string | yes | The termination token sent by email to the admin contact |

```json
{
  "commentary": "string",
  "commentaryFutureUse": "string",
  "commentaryReason": "string",
  "futureUse": "NOT_REPLACING_SERVICE",
  "reason": "FEATURES_DONT_SUIT_ME",
  "token": "string"
}
```

### Responses

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

```json
"string"
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/1.0/domain/zone/{zoneName}/confirmTermination" \
  -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: services.confirmTermination
result = client.post("/domain/zone/{zoneName}/confirmTermination",
	commentary = None, # Commentary about your termination request (type: string)
	commentaryFutureUse = None, # Commentary about your future use (type: string)
	commentaryReason = None, # Commentary about your reason for termination request (type: string)
	futureUse = None, # All future uses you can provide for a service termination (type: service.TerminationFutureUseEnum)
	reason = None, # All reasons you can provide for a service termination (type: service.TerminationReasonEnum)
	token = None, # The termination token sent by email to the admin contact (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: services.confirmTermination
$result = $ovh->post("/domain/zone/{zoneName}/confirmTermination", array(
	commentary => null, // Commentary about your termination request (type: string)
	commentaryFutureUse => null, // Commentary about your future use (type: string)
	commentaryReason => null, // Commentary about your reason for termination request (type: string)
	futureUse => null, // All future uses you can provide for a service termination (type: service.TerminationFutureUseEnum)
	reason => null, // All reasons you can provide for a service termination (type: service.TerminationReasonEnum)
	token => null, // The termination token sent by email to the admin contact (type: string)
));

print_r($result);
?>
```
