# Network › Global LB › Zones 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

> 6 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/global-lb/zones/

OpenAPI v1: https://api.eu.ovhcloud.com/v1/__schemas/developer-hub-navigation/network/global-lb/zones.json?format=openapi3
OpenAPI v2: https://api.eu.ovhcloud.com/v2/__schemas/developer-hub-navigation/network/global-lb/zones.json?format=openapi3

## Operations

- `GET /dns/gslb/zone` — List GSLB hosted zones
- `GET /dns/gslb/zone/{zoneId}` — Get a GSLB hosted zone
- `POST /dns/gslb/zone` — Create a GSLB hosted zone with SOA and NS records
- `PATCH /dns/gslb/zone/{zoneId}` — Update a GSLB hosted zone, including its SOA configuration
- `DELETE /dns/gslb/zone/{zoneId}` — Delete an empty GSLB hosted zone
- `POST /dns/gslb/zone/{zoneId}/refresh` — Push the hosted zone and its record sets again to all GSLB name servers

## List GSLB hosted zones

`GET /v2/dns/gslb/zone`

Link: https://developers.eu.ovhcloud.com/reference/network/global-lb/zones/#getAllGslbZones

**Status:** Alpha version  
**IAM actions:** `gslbZone:apiovh:zone/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `X-Pagination-Cursor` | header | string |  | Pagination cursor |
| `X-Pagination-Size` | header | integer |  | Pagination size |
| `iamTags` | query | object |  | Filter resources on IAM tags |
| `name` | query | string |  | Filter by zone name prefix, ignoring case. The filter applies to each page of authorized zones. A page can hold fewer zones than requested. The total counts every authorized zone. |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | dns.gslb.HostedZoneWithIAM[] | successful operation |
| 400 | object | Error 400 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `comment` | string | read-only | Optional zone description |
| `createdAt` | string (date-time) | read-only | Creation timestamp |
| `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` | string (uuid) | read-only | Unique identifier of the hosted zone |
| `name` | string | read-only | Fully qualified domain name with a trailing dot |
| `nameServers` | string[] | read-only | Assigned authoritative nameservers |
| `recordCount` | integer | read-only | Number of record sets in the zone |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Resource lifecycle status — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `soa` | dns.gslb.SoaRecord | read-only | Start of Authority configuration for the hosted zone. Null when the name servers cannot currently report the SOA. |
| `soa.expire` | integer | read-only | Expiry interval in seconds |
| `soa.hostmaster` | string | read-only | Email address of the zone administrator, written in SOA RNAME format with the @ replaced by a dot, for example hostmaster.example.com. |
| `soa.minimum` | integer | read-only | Negative caching time to live in seconds |
| `soa.name` | string | read-only | Hosted zone name with a trailing dot |
| `soa.primary` | string | read-only | Primary authoritative nameserver |
| `soa.refresh` | integer | read-only | Refresh interval in seconds |
| `soa.retry` | integer | read-only | Retry interval in seconds |
| `soa.serial` | integer | read-only | SOA serial number |
| `soa.ttl` | integer | read-only | Time to live of the SOA record in seconds |
| `updatedAt` | string (date-time) | read-only | Last modification timestamp |

```json
[
  {
    "comment": "string",
    "createdAt": "2024-01-01T12:00:00Z",
    "iam": {
      "displayName": "string",
      "id": "00000000-0000-0000-0000-000000000000",
      "state": "EXPIRED",
      "tags": {
        "key": "string"
      },
      "urn": "string"
    },
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "string",
    "nameServers": [
      "string"
    ],
    "recordCount": 0,
    "resourceStatus": "CREATING",
    "soa": {
      "expire": 0,
      "hostmaster": "string",
      "minimum": 0,
      "name": "string",
      "primary": "string",
      "refresh": 0,
      "retry": 0,
      "serial": 0,
      "ttl": 0
    },
    "updatedAt": "2024-01-01T12:00:00Z"
  }
]
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/dns/gslb/zone" \
  -H "accept: application/json" \
  -H "X-Schemas-Version: 2026-06" \
  -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("/v2/dns/gslb/zone")

# 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("/v2/dns/gslb/zone");

print_r($result);
?>
```

## Get a GSLB hosted zone

`GET /v2/dns/gslb/zone/{zoneId}`

Link: https://developers.eu.ovhcloud.com/reference/network/global-lb/zones/#getGslbZone

**Status:** Alpha version  
**IAM actions:** `gslbZone:apiovh:zone/get`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `zoneId` | path | string (uuid) | yes | Zone ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | dns.gslb.HostedZoneWithIAM | successful operation |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `comment` | string | read-only | Optional zone description |
| `createdAt` | string (date-time) | read-only | Creation timestamp |
| `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` | string (uuid) | read-only | Unique identifier of the hosted zone |
| `name` | string | read-only | Fully qualified domain name with a trailing dot |
| `nameServers` | string[] | read-only | Assigned authoritative nameservers |
| `recordCount` | integer | read-only | Number of record sets in the zone |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Resource lifecycle status — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `soa` | dns.gslb.SoaRecord | read-only | Start of Authority configuration for the hosted zone. Null when the name servers cannot currently report the SOA. |
| `soa.expire` | integer | read-only | Expiry interval in seconds |
| `soa.hostmaster` | string | read-only | Email address of the zone administrator, written in SOA RNAME format with the @ replaced by a dot, for example hostmaster.example.com. |
| `soa.minimum` | integer | read-only | Negative caching time to live in seconds |
| `soa.name` | string | read-only | Hosted zone name with a trailing dot |
| `soa.primary` | string | read-only | Primary authoritative nameserver |
| `soa.refresh` | integer | read-only | Refresh interval in seconds |
| `soa.retry` | integer | read-only | Retry interval in seconds |
| `soa.serial` | integer | read-only | SOA serial number |
| `soa.ttl` | integer | read-only | Time to live of the SOA record in seconds |
| `updatedAt` | string (date-time) | read-only | Last modification timestamp |

```json
{
  "comment": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "iam": {
    "displayName": "string",
    "id": "00000000-0000-0000-0000-000000000000",
    "state": "EXPIRED",
    "tags": {
      "key": "string"
    },
    "urn": "string"
  },
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "string",
  "nameServers": [
    "string"
  ],
  "recordCount": 0,
  "resourceStatus": "CREATING",
  "soa": {
    "expire": 0,
    "hostmaster": "string",
    "minimum": 0,
    "name": "string",
    "primary": "string",
    "refresh": 0,
    "retry": 0,
    "serial": 0,
    "ttl": 0
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X GET \
  "https://api.eu.ovhcloud.com/v2/dns/gslb/zone/{zoneId}" \
  -H "accept: application/json" \
  -H "X-Schemas-Version: 2026-06" \
  -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("/v2/dns/gslb/zone/{zoneId}")

# 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("/v2/dns/gslb/zone/{zoneId}");

print_r($result);
?>
```

## Create a GSLB hosted zone with SOA and NS records

`POST /v2/dns/gslb/zone`

Link: https://developers.eu.ovhcloud.com/reference/network/global-lb/zones/#createGslbZone

**Status:** Alpha version  
**IAM actions:** `gslbZone:apiovh:zone/create`

### Request body (required)

Type: `dns.gslb.CreateHostedZoneRequest`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `comment` | string |  | Optional description. At most 256 characters. |
| `name` | string | yes | Fully qualified domain name with a trailing dot. Immutable after creation. At most 254 characters. |

```json
{
  "comment": "string",
  "name": "string"
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | dns.gslb.HostedZone | successful operation |
| 400 | object | Error 400 response |
| 409 | object | Error 409 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `comment` | string | read-only | Optional zone description |
| `createdAt` | string (date-time) | read-only | Creation timestamp |
| `id` | string (uuid) | read-only | Unique identifier of the hosted zone |
| `name` | string | read-only | Fully qualified domain name with a trailing dot |
| `nameServers` | string[] | read-only | Assigned authoritative nameservers |
| `recordCount` | integer | read-only | Number of record sets in the zone |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Resource lifecycle status — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `soa` | dns.gslb.SoaRecord | read-only | Start of Authority configuration for the hosted zone. Null when the name servers cannot currently report the SOA. |
| `soa.expire` | integer | read-only | Expiry interval in seconds |
| `soa.hostmaster` | string | read-only | Email address of the zone administrator, written in SOA RNAME format with the @ replaced by a dot, for example hostmaster.example.com. |
| `soa.minimum` | integer | read-only | Negative caching time to live in seconds |
| `soa.name` | string | read-only | Hosted zone name with a trailing dot |
| `soa.primary` | string | read-only | Primary authoritative nameserver |
| `soa.refresh` | integer | read-only | Refresh interval in seconds |
| `soa.retry` | integer | read-only | Retry interval in seconds |
| `soa.serial` | integer | read-only | SOA serial number |
| `soa.ttl` | integer | read-only | Time to live of the SOA record in seconds |
| `updatedAt` | string (date-time) | read-only | Last modification timestamp |

```json
{
  "comment": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "string",
  "nameServers": [
    "string"
  ],
  "recordCount": 0,
  "resourceStatus": "CREATING",
  "soa": {
    "expire": 0,
    "hostmaster": "string",
    "minimum": 0,
    "name": "string",
    "primary": "string",
    "refresh": 0,
    "retry": 0,
    "serial": 0,
    "ttl": 0
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/dns/gslb/zone" \
  -H "accept: application/json" \
  -H "X-Schemas-Version: 2026-06" \
  -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: dns.gslb.CreateHostedZoneRequest
result = client.post("/v2/dns/gslb/zone",
	comment = None, # Optional description. At most 256 characters. (type: string, nullable)
	name = None, # Fully qualified domain name with a trailing dot. Immutable after creation. At most 254 characters. (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: dns.gslb.CreateHostedZoneRequest
$result = $ovh->post("/v2/dns/gslb/zone", array(
	comment => null, // Optional description. At most 256 characters. (type: string, nullable)
	name => null, // Fully qualified domain name with a trailing dot. Immutable after creation. At most 254 characters. (type: string)
));

print_r($result);
?>
```

## Update a GSLB hosted zone, including its SOA configuration

`PATCH /v2/dns/gslb/zone/{zoneId}`

Link: https://developers.eu.ovhcloud.com/reference/network/global-lb/zones/#updateGslbZone

**Status:** Alpha version  
**IAM actions:** `gslbZone:apiovh:zone/edit`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `zoneId` | path | string (uuid) | yes | Zone ID |

### Request body (required)

Type: `dns.gslb.UpdateHostedZoneRequest`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `comment` | string |  | New description. When omitted, the current comment is kept. When null, the comment is removed. At most 256 characters. |
| `nameServers` | string[] |  | New authoritative name servers, each with a trailing dot. The list replaces the one currently set. When omitted, the current name servers are kept. When null, the default name servers are restored. |
| `soa` | dns.gslb.UpdateSoaRequest |  | Partial update of the zone SOA configuration. When omitted, the current SOA is kept. A null value is rejected. The SOA cannot be removed. |
| `soa.expire` | integer |  | Expiry interval from 0 to 2147483647 seconds |
| `soa.hostmaster` | string |  | Email address of the zone administrator, written in SOA RNAME format with the @ replaced by a dot, for example hostmaster.example.com. |
| `soa.minimum` | integer |  | Negative caching time to live from 0 to 2147483647 seconds |
| `soa.primary` | string |  | Primary nameserver FQDN |
| `soa.refresh` | integer |  | Refresh interval from 0 to 2147483647 seconds |
| `soa.retry` | integer |  | Retry interval from 0 to 2147483647 seconds |
| `soa.serial` | integer |  | Non-negative SOA serial number |
| `soa.ttl` | integer |  | Time to live of the SOA record. From 0 to 2147483647 seconds. |

```json
{
  "comment": "string",
  "nameServers": [
    "string"
  ],
  "soa": {
    "expire": 0,
    "hostmaster": "string",
    "minimum": 0,
    "primary": "string",
    "refresh": 0,
    "retry": 0,
    "serial": 0,
    "ttl": 0
  }
}
```

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | dns.gslb.HostedZone | successful operation |
| 400 | object | Error 400 response |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `comment` | string | read-only | Optional zone description |
| `createdAt` | string (date-time) | read-only | Creation timestamp |
| `id` | string (uuid) | read-only | Unique identifier of the hosted zone |
| `name` | string | read-only | Fully qualified domain name with a trailing dot |
| `nameServers` | string[] | read-only | Assigned authoritative nameservers |
| `recordCount` | integer | read-only | Number of record sets in the zone |
| `resourceStatus` | common.ResourceStatusEnum | read-only | Resource lifecycle status — one of `CREATING`, `CREATION_PLANNED`, `DELETING`, `ERROR`, `OUT_OF_SYNC`, `READY`, `SUSPENDED`, `UNKNOWN`, `UPDATING` |
| `soa` | dns.gslb.SoaRecord | read-only | Start of Authority configuration for the hosted zone. Null when the name servers cannot currently report the SOA. |
| `soa.expire` | integer | read-only | Expiry interval in seconds |
| `soa.hostmaster` | string | read-only | Email address of the zone administrator, written in SOA RNAME format with the @ replaced by a dot, for example hostmaster.example.com. |
| `soa.minimum` | integer | read-only | Negative caching time to live in seconds |
| `soa.name` | string | read-only | Hosted zone name with a trailing dot |
| `soa.primary` | string | read-only | Primary authoritative nameserver |
| `soa.refresh` | integer | read-only | Refresh interval in seconds |
| `soa.retry` | integer | read-only | Retry interval in seconds |
| `soa.serial` | integer | read-only | SOA serial number |
| `soa.ttl` | integer | read-only | Time to live of the SOA record in seconds |
| `updatedAt` | string (date-time) | read-only | Last modification timestamp |

```json
{
  "comment": "string",
  "createdAt": "2024-01-01T12:00:00Z",
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "string",
  "nameServers": [
    "string"
  ],
  "recordCount": 0,
  "resourceStatus": "CREATING",
  "soa": {
    "expire": 0,
    "hostmaster": "string",
    "minimum": 0,
    "name": "string",
    "primary": "string",
    "refresh": 0,
    "retry": 0,
    "serial": 0,
    "ttl": 0
  },
  "updatedAt": "2024-01-01T12:00:00Z"
}
```

### Example

```bash
curl -X PATCH \
  "https://api.eu.ovhcloud.com/v2/dns/gslb/zone/{zoneId}" \
  -H "accept: application/json" \
  -H "X-Schemas-Version: 2026-06" \
  -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: dns.gslb.UpdateHostedZoneRequest
result = client.patch("/v2/dns/gslb/zone/{zoneId}",
	comment = None, # New description. When omitted, the current comment is kept. When null, the comment is removed. At most 256 characters. (type: string, nullable)
	nameServers = None, # New authoritative name servers, each with a trailing dot. The list replaces the one currently set. When omitted, the current name servers are kept. When null, the default name servers are restored. (type: array, nullable)
	soa = None, # Partial update of the zone SOA configuration. When omitted, the current SOA is kept. A null value is rejected. The SOA cannot be removed. (type: dns.gslb.UpdateSoaRequest, 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: dns.gslb.UpdateHostedZoneRequest
$result = $ovh->patch("/v2/dns/gslb/zone/{zoneId}", array(
	comment => null, // New description. When omitted, the current comment is kept. When null, the comment is removed. At most 256 characters. (type: string, nullable)
	nameServers => null, // New authoritative name servers, each with a trailing dot. The list replaces the one currently set. When omitted, the current name servers are kept. When null, the default name servers are restored. (type: array, nullable)
	soa => null, // Partial update of the zone SOA configuration. When omitted, the current SOA is kept. A null value is rejected. The SOA cannot be removed. (type: dns.gslb.UpdateSoaRequest, nullable)
));

print_r($result);
?>
```

## Delete an empty GSLB hosted zone

`DELETE /v2/dns/gslb/zone/{zoneId}`

Link: https://developers.eu.ovhcloud.com/reference/network/global-lb/zones/#deleteGslbZone

**Status:** Alpha version  
**IAM actions:** `gslbZone:apiovh:zone/delete`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `zoneId` | path | string (uuid) | yes | Zone ID |

### Responses

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

### Example

```bash
curl -X DELETE \
  "https://api.eu.ovhcloud.com/v2/dns/gslb/zone/{zoneId}" \
  -H "accept: application/json" \
  -H "X-Schemas-Version: 2026-06" \
  -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("/v2/dns/gslb/zone/{zoneId}")

# 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("/v2/dns/gslb/zone/{zoneId}");

print_r($result);
?>
```

## Push the hosted zone and its record sets again to all GSLB name servers

`POST /v2/dns/gslb/zone/{zoneId}/refresh`

Link: https://developers.eu.ovhcloud.com/reference/network/global-lb/zones/#refreshGslbZone

**Status:** Alpha version  
**IAM actions:** `gslbZone:apiovh:zone/refresh`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `zoneId` | path | string (uuid) | yes | Zone ID |

### Responses

| Status | Type | Description |
| --- | --- | --- |
| 200 | dns.gslb.ZoneRefreshResult | successful operation |
| 404 | object | Error 404 response |

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `message` | string | read-only | Explanation of a `PARTIAL` or `ERROR` status. It names the faulty record when the name servers reject the zone content. Null when `status` is `OK`. |
| `recordSetCount` | integer | read-only | Number of DNS resource record sets sent to the name servers, counting each name and type once and including SOA and NS |
| `status` | dns.gslb.SyncStatusEnum | read-only | Aggregate push status: OK when every name server was updated, PARTIAL when the push failed on some but not all name servers, ERROR when it failed on every name server — one of `ERROR`, `OK`, `PARTIAL` |
| `zone` | string | read-only | Hosted zone name |

```json
{
  "message": "string",
  "recordSetCount": 0,
  "status": "ERROR",
  "zone": "string"
}
```

### Example

```bash
curl -X POST \
  "https://api.eu.ovhcloud.com/v2/dns/gslb/zone/{zoneId}/refresh" \
  -H "accept: application/json" \
  -H "X-Schemas-Version: 2026-06" \
  -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("/v2/dns/gslb/zone/{zoneId}/refresh")

# 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("/v2/dns/gslb/zone/{zoneId}/refresh");

print_r($result);
?>
```
