# DescribePolicyDetail

## 1. API Description

This API (DescribePolicyDetail) is used to get details of a protection strategy.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type   | Description             |
| -------------- | -------- | ------ | ----------------------- |
| policyId       | Yes      | String | Protection strategy ID. |

## 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> |
| policyId            | String                                                                                                                    | Protection strategy ID.                                                                                               |
| policyName          | String                                                                                                                    | The name of the protection strategy.                                                                                  |
| attachmentIps       | Array of String                                                                                                           | List of linked protection target IPs.                                                                                 |
| createTime          | String                                                                                                                    | Creation time.                                                                                                        |
| blackIps            | Array of String                                                                                                           | IP deny list.                                                                                                         |
| whiteIps            | Array of String                                                                                                           | IP allow list.                                                                                                        |
| blackIpListExpireAt | Integer                                                                                                                   | IP deny timeout.                                                                                                      |
| blockProtocols      | Array of [Protocol](https://docs.console.zenlayer.com/api-reference/compute/datastructure#protocol)                       | Enabled protocol blocking. UDP and TCP cannot be enabled at the same time.                                            |
| ports               | Array of [DdosPolicyPort](https://docs.console.zenlayer.com/api-reference/compute/datastructure#ddospolicyport)           | Port blocking.                                                                                                        |
| blockRegions        | Array of String                                                                                                           | Regions blocked.                                                                                                      |
| reflectUdpPort      | Array of [DdosReflectUdpPort](https://docs.console.zenlayer.com/api-reference/compute/datastructure#ddosreflectudpport)   | Port list for reflection attack filtering.                                                                            |
| trafficControl      | [DdosTrafficControl](https://docs.console.zenlayer.com/api-reference/compute/datastructure#ddostrafficcontrol)            | Source IP rate limiting configurations.                                                                               |
| fingerPrintRules    | Array of [DdosFingerprintRule](https://docs.console.zenlayer.com/api-reference/compute/datastructure#ddosfingerprintrule) | Fingerprint filtering configurations.                                                                                 |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Get protection strategy details.**

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

Request：
{
    "policyId": "<policyId>"
}

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
    "policy": "policyId",
    "policyName": "xxx",
    "attachmentIps": ["10.0.0.1","10.0.0.2"],
    "createTime": "2025-07-16T01:26:39Z",
    "blackIps": ["10.0.0.1"],
    "whiteIps": ["10.0.0.1"],
    "blackIpListExpireAt": 10,
    "blockProtocols": ["TCP","UDP"],
    "ports": [
      {
        "protocol": "TCP",
        "srcPortStart": 1,
        "srcPortEnd": 100,
        "dstPortStart": 1,
        "dstPortEnd": 100,
        "action": "Accept"
      }
    ],
    "blockRegions": ["AFG"],
    "reflectUdpPort": [
      {
        "port": 10
      }
    ],
    "trafficControl": {
      "bpsEnabled": false,
      "bps": null,
      "ppsEnabled": false,
      "pps": null,
      "synBPSEnabled": false,
      "synBPS": null,
      "synPPSEnabled": false,
      "synPPS": null
    },
    "fingerPrintRules": [
      {
        "protocol": "TCP",
        "srcPortStart": 1,
        "srcPortEnd": 100,
        "dstPortStart": 1,
        "dstPortEnd": 100,
        "minPktLength": 1,
        "maxPktLength": 100,
        "offset": 1,
        "matchBytes": "xxx",
        "action": "Accept"
      }
    ]
  }
}
```

{% 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

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

| HTTP Status Code | Error Code                        | Description                             |
| ---------------- | --------------------------------- | --------------------------------------- |
| 404              | INVALID\_DDOS\_POLICY\_NOT\_FOUND | The protection strategy does not exist. |
