> 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/zlb/load-balancer-instance/terminateloadbalancer.md).

# TerminateLoadBalancer

## 1. API Description

This API (TerminateLoadBalancer) is used to delete a specified load balancer instance.

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

* After the instance is deleted, it may be retained for a period of time, during which its state is `RECYCLED`. You can call [RestoreLoadBalancer](https://docs.console.zenlayer.com/api-reference/zlb/load-balancer-instance/restoreloadbalancer.md) to restore the instance.
* The EIPs specified through `eipIds` are moved to the recycle bin together with the instance. Only non-default EIPs that are bound to this instance are released; other IDs are ignored.
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type            | Description                                                                                                                                                                                                                                                                                                                                             |
| -------------- | -------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| loadBalancerId | Yes      | String          | <p>Load balancer instance ID.</p><p>It can be obtained by calling <a href="https://docs.console.zenlayer.com/api-reference/zlb/load-balancer-instance/describeloadbalancers.md">DescribeLoadBalancers</a>.</p>                                                                                                                                          |
| eipIds         | No       | Array of String | <p>List of EIP IDs to be released together with the instance.</p><p>It can be obtained by calling <del>DescribeEips</del> with <code>associatedId</code> set to the ID of this load balancer instance.</p><p>Only non-default EIPs that are bound to this instance are released; other IDs are ignored.</p><p>If not specified, no EIP is released.</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> |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Delete a load balancer.**

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

Request:
{
  "loadBalancerId": "<loadBalancerId>"
}

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

**2. Delete a load balancer and release the EIPs bound to it at the same time.**

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

Request:
{
  "loadBalancerId": "<loadBalancerId>",
  "eipIds": ["<eipId>"]
}

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

{% endtab %}
{% endtabs %}

## 5. Developer Resources

Zenlayer Cloud API 2.0 integrates [SDKs](https://docs.console.zenlayer.com/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](https://docs.console.zenlayer.com/api-reference/api-introduction/instruction/commonerrorcode.md).

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