# DescribeRoutes

## 1. API Description

This API (DescribeRoutes) is used to query the details of routes. You can filter the query results with the route ID or name. The route list includes both system-generated routes and user-created routes.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name       | Required | Type                                                                                         | Description                                                                                                               |
| -------------------- | -------- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| routeIds             | No       | Array of String                                                                              | Route ID(s).                                                                                                              |
| vpcId                | No       | String                                                                                       | Global VPC ID.                                                                                                            |
| ipVersion            | No       | [IpType](https://docs.console.zenlayer.com/api-reference/compute/datastructure#iptype)       | <p>IP type.</p><p>The optional values are as follows:</p><p>IPv4 , IPv6</p>                                               |
| routeType            | No       | [RouteType](https://docs.console.zenlayer.com/api-reference/compute/datastructure#routetype) | Route type.                                                                                                               |
| name                 | No       | String                                                                                       | <p>Route name.</p><p>Fuzzy query is supported.</p>                                                                        |
| destinationCidrBlock | No       | String                                                                                       | <p>Destination CIDR block for IPv4 or IPv6.</p><p>For example: 10.0.1.0/24 .</p>                                          |
| pageSize             | No       | Integer                                                                                      | <p>Number of items in the current page result.</p><p>Available value range: \[1, 1000].</p><p>Value range: \[1, 1000]</p> |
| pageNum              | No       | Integer                                                                                      | <p>Number of pages returned.</p><p>Available value range: \[1, +).</p><p>Value range: \[1, +)</p><p>Default value: 1</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 routes meeting the filtering conditions.                                                                    |
| dataSet        | Array of [RouteInfo](https://docs.console.zenlayer.com/api-reference/compute/datastructure#routeinfo) | Information on a route.                                                                                               |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query all the available routes.**

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

Request：
{}

Response：
{
  "dataSet": [
    {
      "cidrBlock": "10.130.0.0/20",
      "createTime": "2025-08-27T03:39:00Z",
      "destinationCidrBlock": "10.130.0.0/20",
      "ipVersion": "IPv4",
      "name": "<name>",
      "nextHopId": "<nextHopId>",
      "nextHopName": "<nextHopName>",
      "nextHopType": "VPC",
      "priority": 0,
      "routeId": "<routeId>",
      "sourceCidrBlock": "",
      "type": "RouteTypeSubnet",
      "vpcId": "<vpcId>",
      "vpcName": "<vpcName>"
    }
  ],
  "requestId": "T1626541C-64A5-4E90-B080-D85429447A69",
  "totalCount": 1
}
```

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