> 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/networking/sdn/port/destroyport.md).

# DestroyPort

## 1. API Description

This API is used to release a port.

#### Prerequisites

Before releasing a port, you can call [`DescribePorts`](/api-reference/networking/sdn/port/describeports.md#DescribePorts) to query port list.

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

* <mark style="color:blue;">This operation is irreversible. Once the operation is successful, the port will be completely released. Please operate with caution.</mark>
* <mark style="color:blue;">Only operations on ports in recycle bin are supported.</mark>
* <mark style="color:blue;">This API is an async API. A request ID is returned after the release request is sent. However, it does not mean the releasing has been completed. The status of the port will be</mark> <mark style="color:blue;">`DESTROYING`</mark> <mark style="color:blue;">during the releasing. You can use</mark> [<mark style="color:purple;">`DescribePorts`</mark>](/api-reference/networking/sdn/port/describeports.md#describeports) <mark style="color:blue;">to query the status of the port. If the status of the port changes</mark> <mark style="color:blue;">`DESTROYING`</mark> <mark style="color:blue;">to</mark> <mark style="color:blue;">`DESTROYED`</mark><mark style="color:blue;">, it means that the port has been released successfully. Any operations on the port are not allowed while releasing.</mark>
  {% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

<table><thead><tr><th width="198">Parameter Name</th><th width="128">Required</th><th width="119">Type</th><th>Description</th></tr></thead><tbody><tr><td>portId</td><td>Yes</td><td>String</td><td>Port ID.</td></tr></tbody></table>

## 3. Output Parameters

<table><thead><tr><th width="200.33333333333331">Parameter Name</th><th width="112">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" %}
**Release a port.**

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

Request:
{
  "portId": "your-port-id"
}

Response:
{
  "requestId": "T3811A0E7-C250-40A2-96AD-08AD759E1BC2",
  "response": {
    "requestId": "T3811A0E7-C250-40A2-96AD-08AD759E1BC2"
  }
}
```

{% 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).​

<table><thead><tr><th width="210.33333333333331">HTTP Status Code</th><th width="303">Error Code</th><th>Description</th></tr></thead><tbody><tr><td>7105</td><td>SELF_SERVICE_PORT_NOT_FOUND</td><td>Port not found.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.console.zenlayer.com/api-reference/networking/sdn/port/destroyport.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
