> 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/byo-asn/describebyoasns.md).

# DescribeByoAsns

## 1. API Description

This API (DescribeByoAsns) is used to query the details of one or more bring-your-own ASNs.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name  | Required | Type                                                                 | Description                                                                                            |
| --------------- | -------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| byoAsnIds       | No       | Array of String                                                      | <p>ID list of the BYO ASNs.</p><p>Up to 100 IDs can be queried.</p>                                    |
| asn             | No       | Integer                                                              | Filter by the exact ASN number.                                                                        |
| status          | No       | [ByoAsnStatus](/api-reference/zec/datastructure.md#byoasnstatus)     | Filter by status.                                                                                      |
| resourceGroupId | No       | String                                                               | Filter by resource group ID.                                                                           |
| orderBy         | No       | [ByoAsnOrderBy](/api-reference/zec/datastructure.md#byoasnorderby)   | <p>Sorting field.</p><p>Sorts by creation time if not specified.</p>                                   |
| direction       | No       | [OrderDirection](/api-reference/zec/datastructure.md#orderdirection) | <p>Sorting direction.</p><p>Sorts in descending order if not specified.</p>                            |
| pageSize        | No       | Integer                                                              | <p>Number of items in the current page result.</p><p>Default value: 20;</p><p>Maximum value: 1000.</p> |
| pageNum         | No       | Integer                                                              | <p>Number of pages returned.</p><p>Default value: 1.</p><p>Default value: 1</p>                        |
| tagKeys         | No       | Array of String                                                      | <p>Search by tag key.</p><p>A maximum of 20 tag keys can be used.</p>                                  |
| tags            | No       | Array of [Tag](/api-reference/zec/datastructure.md#tag)              | <p>Search by tags.</p><p>Maximum 20 tags.</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> |
| totalCount     | Integer                                                               | Number of BYO ASNs meeting the filtering conditions.                                                                  |
| dataSet        | Array of [ByoAsnInfo](/api-reference/zec/datastructure.md#byoasninfo) | BYO ASN result set.                                                                                                   |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Query the list of BYO ASNs under the current account.**

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

Request：
{
  "pageNum": 1,
  "pageSize": 20
}

Response：
{
  "requestId": "TBFC01FCF-6439-4530-ADBC-16809F0C3E8F",
  "response": {
    "requestId": "TBFC01FCF-6439-4530-ADBC-16809F0C3E8F",
    "totalCount": 2,
    "dataSet": [
      {
        "byoAsnId": "byoasn-3JK29DKS",
        "asn": 12340,
        "status": "AVAILABLE",
        "type": "BYOASN",
        "verifyCode": "62610:831522",
        "exportDeclaration": "export: to AS62610 action community .= {62610:831522}; announce AS12340",
        "ipv4CidrCount": 1,
        "ipv6CidrCount": 1,
        "createTime": "2026-09-03T07:21:17Z",
        "resourceGroup": {
          "resourceGroupId": "9d5f8e2a4c1b47f3",
          "resourceGroupName": "Default Resource Group"
        },
        "tags": {
          "tagList": [
            {
              "key": "env",
              "value": "prod"
            }
          ]
        }
      },
      {
        "byoAsnId": "byoasn-7PQ41MZX",
        "asn": 59798,
        "status": "VERIFYING",
        "type": "BYOASN",
        "verifyCode": "62610:519890",
        "exportDeclaration": "export: to AS62610 action community .= {62610:519890}; announce AS59798",
        "ipv4CidrCount": 0,
        "ipv6CidrCount": 0,
        "createTime": "2026-09-03T09:03:52Z",
        "resourceGroup": {
          "resourceGroupId": "9d5f8e2a4c1b47f3",
          "resourceGroupName": "Default Resource Group"
        },
        "tags": {
          "tagList": []
        }
      }
    ]
  }
}
```

**2. Sort by ASN number in ascending order.**

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

Request：
{
  "orderBy": "ASN",
  "direction": "ASC"
}

Response：
{
  "requestId": "TBFC01FCF-6439-4530-ADBC-16809F0C3E8F",
  "response": {
    "requestId": "TBFC01FCF-6439-4530-ADBC-16809F0C3E8F",
    "totalCount": 2,
    "dataSet": [
      {
        "byoAsnId": "byoasn-3JK29DKS",
        "asn": 12340,
        "status": "AVAILABLE",
        "type": "BYOASN",
        "verifyCode": "62610:831522",
        "exportDeclaration": "export: to AS62610 action community .= {62610:831522}; announce AS12340",
        "ipv4CidrCount": 1,
        "ipv6CidrCount": 1,
        "createTime": "2026-09-03T07:21:17Z",
        "resourceGroup": {
          "resourceGroupId": "9d5f8e2a4c1b47f3",
          "resourceGroupName": "Default Resource Group"
        },
        "tags": {
          "tagList": []
        }
      },
      {
        "byoAsnId": "byoasn-7PQ41MZX",
        "asn": 59798,
        "status": "VERIFYING",
        "type": "BYOASN",
        "verifyCode": "62610:519890",
        "exportDeclaration": "export: to AS62610 action community .= {62610:519890}; announce AS59798",
        "ipv4CidrCount": 0,
        "ipv6CidrCount": 0,
        "createTime": "2026-09-03T09:03:52Z",
        "resourceGroup": {
          "resourceGroupId": "9d5f8e2a4c1b47f3",
          "resourceGroupName": "Default Resource Group"
        },
        "tags": {
          "tagList": []
        }
      }
    ]
  }
}
```

**3. Query only the BYO ASNs that are already available.**

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

Request：
{
  "status": "AVAILABLE"
}

Response：
{
  "requestId": "TBFC01FCF-6439-4530-ADBC-16809F0C3E8F",
  "response": {
    "requestId": "TBFC01FCF-6439-4530-ADBC-16809F0C3E8F",
    "totalCount": 1,
    "dataSet": [
      {
        "byoAsnId": "byoasn-3JK29DKS",
        "asn": 12340,
        "status": "AVAILABLE",
        "type": "BYOASN",
        "verifyCode": "62610:831522",
        "exportDeclaration": "export: to AS62610 action community .= {62610:831522}; announce AS12340",
        "ipv4CidrCount": 1,
        "ipv6CidrCount": 1,
        "createTime": "2026-09-03T07:21:17Z",
        "resourceGroup": {
          "resourceGroupId": "9d5f8e2a4c1b47f3",
          "resourceGroupName": "Default Resource Group"
        },
        "tags": {
          "tagList": []
        }
      }
    ]
  }
}
```

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