> 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/elastic-ip/unassociateeipaddress.md).

# UnassociateEipAddress

## 1. API Description

This API (UnassociateEipAddress) is used to disassociate elastic IPs from resources in the same region.

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

* The interface returns the set of EIP IDs that failed to be unbound. An empty set indicates that all of them were unbound successfully.
* If an elastic IP has already been unbound, performing the operation again does not report an error.
* The default elastic IP cannot be unbound.
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type            | Description                                                                                                                                                    |
| -------------- | -------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| eipIds         | Yes      | Array of String | <p>ID list of the elastic IPs to be unbound.</p><p>It can be obtained by calling <a href="/api-reference/zec/elastic-ip/describeeips.md">DescribeEips</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> |
| failedEipIds   | Array of String | Elastic IP IDs that failed to operate.                                                                                |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Disassociate an elastic IP (EIP) from the cloud resource it is bound to.**

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

Request：
{
    "eipIds": ["eipId1","eipId2"]
}

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

{% 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                                                  |
| ---------------- | -------------------------------------------- | ------------------------------------------------------------ |
| 400              | OPERATION\_DENIED\_EIP\_IS\_DEFAULT          | Default public IP cannot be unbound.                         |
| 400              | OPERATION\_DENIED\_EIP\_NOT\_ASSIGNED        | Elastic IP is not bound.                                     |
| 500              | OPERATION\_DENIED\_EIP\_STATUS\_NOT\_SUPPORT | Operations on the EIP with current status are not supported. |
