# DeletePrivateConnect

## 1. API Description

This API is used to delete a Layer 2 private connect.

{% hint style="info" %} <mark style="color:blue;">**Note**</mark>

* <mark style="color:blue;">If you delete your private connect, the Layer 2 network connection will be interrupted and corresponding business will stop. Please operate with caution.</mark>
* <mark style="color:blue;">After deletion, your resources will be suspended for a specified time with the state of</mark> <mark style="color:blue;">`RECYCLED`</mark><mark style="color:blue;">. See</mark> [<mark style="color:purple;">Cloud Networking Billing</mark>](https://docs.console.zenlayer.com/welcome/pricing/cloud-networking-pricing) <mark style="color:blue;">for details. During this time, you can call</mark> [<mark style="color:purple;">`RenewPrivateConnect`</mark>](https://docs.console.zenlayer.com/api-reference/networking/sdn/private-connect/renewprivateconnect) <mark style="color:blue;">to restore your resources.</mark>
* <mark style="color:blue;">This API is an async API. A request ID is returned after the deletion request is sent. However, it does not mean the deletion has been completed. The status of the</mark> <mark style="color:blue;">private connect</mark> <mark style="color:blue;">will be</mark> <mark style="color:blue;">`DELETING`</mark> <mark style="color:blue;">during the deletion. When the state of</mark> <mark style="color:blue;">private connect</mark> <mark style="color:blue;">changes to</mark> <mark style="color:blue;">`RECYCLED`</mark><mark style="color:blue;">, it means that the</mark> <mark style="color:blue;">private connect</mark> <mark style="color:blue;">has been deleted successfully.</mark>
* <mark style="color:blue;">Any change operations on the deleted private connects are not allowed.</mark>
* <mark style="color:blue;">After deletion, you can</mark> [<mark style="color:purple;">`RenewPrivateConnect`</mark>](https://docs.console.zenlayer.com/api-reference/networking/sdn/private-connect/renewprivateconnect) <mark style="color:blue;">to restore your resources or call</mark> [<mark style="color:purple;">`DestroyPrivateConnect`</mark>](https://docs.console.zenlayer.com/api-reference/networking/sdn/private-connect/destroyprivateconnect) <mark style="color:blue;">to release the deleted resources according to your actual needs</mark>.
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

<table><thead><tr><th width="200.87301587301587">Parameter Name</th><th width="115">Required</th><th width="101">Type</th><th>Description</th></tr></thead><tbody><tr><td>privateConnectId</td><td>Yes</td><td>String</td><td>Private connect ID.</td></tr></tbody></table>

## 3. Output Parameters

<table><thead><tr><th width="196.51911009697662">Parameter Name</th><th width="95">Type</th><th>Description</th></tr></thead><tbody><tr><td>requestId</td><td>String</td><td>The unique request ID, which is returned for each request. RequestId is required for locating a problem.</td></tr></tbody></table>

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Delete a Layer 2 private connect.**

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

Request：
{
    "privateConnectId": "your-private-connect-id"
}

Response：
{   
  "requestId": "T98044459-95B2-477E-9A2F-00253A70CC6E",
  "response": {
     "requestId": "T98044459-95B2-477E-9A2F-00253A70CC6E"，
  }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources

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

## 6. Error Codes

No 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).​
