> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/api-reference/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/api-reference/zec/public-ipv6/deleteipv6addresses.md).

# DeleteIpv6Addresses

## 1. API Description

This API (DeleteIpv6Addresses) is used to delete public IPv6 addresses in batches. Each address is processed independently, so a partial failure does not affect the remaining ones. The error code and error message of each failed item are returned in failedIpv6Addresses.

{% hint style="info" %}
**Notes**

* After the public IPv6 address on a network interface is deleted, the stack type of the network interface is downgraded from `IPv4_IPv6` to `IPv4`. The public IPv6 address of a network interface that has only an IPv6 address cannot be deleted.
* The public IPv6 address on a load balancer can be deleted separately. When the load balancer itself is deleted, the public IPv6 address on it is recycled at the same time, and there is no need to call this interface separately.
* The public IPv6 addresses passed in are processed independently one by one, so a partial failure does not affect the deletion of the remaining ones. The error code and error message of each failed item are returned through `failedIpv6Addresses`, and the interface itself still returns success.
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type            | Description                                                                                                                                                                                 |
| -------------- | -------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ipv6Ids        | Yes      | Array of String | <p>ID list of the public IPv6 addresses to be deleted.</p><p>It can be obtained by calling <a href="/api-reference/zec/public-ipv6/describeipv6addresses.md">DescribeIpv6Addresses</a>.</p> |

## 3. Output Parameters

| Parameter Name      | Type                                                                                                        | Description                                                                                                           |
| ------------------- | ----------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| requestId           | String                                                                                                      | <p>The unique request ID, which is returned for each request.</p><p>RequestId is required for locating a problem.</p> |
| failedIpv6Addresses | Array of [DeleteIpv6AddressesFailedItem](/api-reference/zec/datastructure.md#deleteipv6addressesfaileditem) | <p>List of details of the public IPv6 addresses that failed to be deleted.</p><p>Empty if all deletions succeed.</p>  |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Delete public IPv6 addresses in batches, with all of them deleted successfully.**

```json
POST /api/v2/zec HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DeleteIpv6Addresses
<Common Request Params>

Request：
{
  "ipv6Ids": [
    "<ipv6Id1>",
    "<ipv6Id2>"
  ]
}

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
    "failedIpv6Addresses": []
  }
}
```

**2. Partial failure: the successful items have been deleted, and the reasons for the failed items are returned in failedIpv6Addresses.**

```json
POST /api/v2/zec HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DeleteIpv6Addresses
<Common Request Params>

Request：
{
  "ipv6Ids": [
    "<ipv6Id1>",
    "<ipv6Id2>"
  ]
}

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
    "failedIpv6Addresses": [
      {
        "ipv6Id": "<ipv6Id2>",
        "errorCode": "INVALID_NIC_STACK_TYPE_NOT_SUPPORT",
        "errorMsg": "The specified nic `<nicId>` stack type does not support this operation"
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](/api-reference/api-introduction/toolkit/api-sdk.md)，to make it easier for you to call APIs. More programming languages will be supported.

## 6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see [Common Error Codes](/api-reference/api-introduction/instruction/commonerrorcode.md).

| HTTP Status Code | Error Code | Description |
| ---------------- | ---------- | ----------- |
