# DescribeSnapshots

## 1. API Description

This API (DescribeSnapshots) is used to query the details of snapshots.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name  | Required | Type                                                                                                             | Description                                                                 |
| --------------- | -------- | ---------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| snapshotIds     | No       | Array of String                                                                                                  | Filter by the list of snapshot IDs.                                         |
| zoneId          | No       | String                                                                                                           | Availability zone ID to which the snapshot belongs.                         |
| status          | No       | [SnapshotStatusValue](https://docs.console.zenlayer.com/api-reference/compute/datastructure#snapshotstatusvalue) | Filter by the state of the snapshot.                                        |
| diskIds         | No       | Array of String                                                                                                  | Filter by the list of disk IDs to which the snapshot belongs.               |
| diskType        | No       | [DiskType](https://docs.console.zenlayer.com/api-reference/compute/datastructure#disktype)                       | Filter by the disk type of the snapshot.                                    |
| snapshotType    | No       | [SnapshotType](https://docs.console.zenlayer.com/api-reference/compute/datastructure#snapshottype)               | Filter by the snapshot type.                                                |
| snapshotName    | No       | String                                                                                                           | <p>Filter by the snapshot name.</p><p>This field supports fuzzy search.</p> |
| pageSize        | No       | Integer                                                                                                          | <p>Number of items in the current page result.</p><p>Default value: 20</p>  |
| pageNum         | No       | Integer                                                                                                          | <p>Number of pages returned.</p><p>Default value: 1</p>                     |
| resourceGroupId | No       | String                                                                                                           | Filter by resource group 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> |
| totalCount     | Integer                                                                                                     | The total number of snapshots that meet the filtering conditions.                                                     |
| dataSet        | Array of [SnapshotInfo](https://docs.console.zenlayer.com/api-reference/compute/datastructure#snapshotinfo) | The returned snapshot list data.                                                                                      |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query the list of snapshots.**

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

Request：
{
    "snapshotIds": ["snapshotId1","snapshotId2"],
    "zoneId": "asia-east-1a",
    "status": "AVAILABLE",
    "snapshotName": "snapshot-state",
    "pageSize": 20,
    "pageNum": 1
}

Response：
{
  "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
  "response": {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
    "totalCount": 1,
    "dataSet": [
      {
        "snapshotId": "<snapshotId>",
        "snapshotName": "snapshotName",
        "zoneId": "asia-east-1a",
        "status": "AVAILABLE",
        "diskId": "<diskId>",
        "createTime": "2025-07-02T09:51:00Z",
        "resourceGroupId": "0a253bb0-eb7d-4328-84ec-fc8d1487b31a",
        "resourceGroupName": "Default Resource Group",
      }
    ]
  }
}
```

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