> 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/compute/zec/image/describecustomimages.md).

# DescribeCustomImages

## 1. API Description

This API (DescribeCustomImages) is used to query the list of custom images under the current account.

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name  | Required | Type                                                                   | Description                                                                               |
| --------------- | -------- | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
| regionId        | No       | String                                                                 | Region ID. When specified, only custom images available in that region are returned.      |
| imageIds        | No       | Array of String                                                        | List of image IDs.                                                                        |
| imageName       | No       | String                                                                 | <p>Filter by image name.</p><p>This field supports fuzzy search.</p>                      |
| category        | No       | String                                                                 | The category to which the image belongs.                                                  |
| osType          | No       | [ImageOsType](/api-reference/compute/zec/datastructure.md#imageostype) | Type of operating system.                                                                 |
| imageStatus     | No       | [ImageStatus](/api-reference/compute/zec/datastructure.md#imagestatus) | Status of the image.                                                                      |
| pageNum         | No       | Integer                                                                | <p>The page number of the returned results.</p><p>Default value: 1</p>                    |
| pageSize        | No       | Integer                                                                | <p>The pagination size of the returned results.</p><p>Default is 20, maximum is 1000.</p> |
| resourceGroupId | No       | String                                                                 | Filter by resource group ID.                                                              |
| tagKeys         | No       | Array of String                                                        | <p>Filter by tag keys.</p><p>No more than 20 tag keys are allowed.</p>                    |
| tags            | No       | Array of [Tag](/api-reference/compute/zec/datastructure.md#tag)        | <p>Filter by tags.</p><p>No more than 20 tags are allowed.</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                                                                         | Total number of records matching the criteria.                                                                        |
| dataSet        | Array of [CustomImage](/api-reference/compute/zec/datastructure.md#customimage) | Image list data.                                                                                                      |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Query all custom images under the current account.**

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

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

Response：
{
  "requestId": "TD67947F8-9B29-451F-9965-58AEDB4E5B7C",
  "response": {
    "requestId": "TD67947F8-9B29-451F-9965-58AEDB4E5B7C",
    "dataSet": [
      {
        "imageId": "img-xxxxxxxx",
        "imageName": "my-custom-image",
        "imageType": "CUSTOM_IMAGE",
        "imageSource": "CUSTOM",
        "imageSize": "40",
        "imageDescription": null,
        "imageVersion": "Server 22.04 LTS",
        "imageStatus": "AVAILABLE",
        "nicNetworkType": ["FailOver","VirtioOnly"],
        "category": "Ubuntu",
        "osType": "linux",
        "tags": null,
        "regionIdList": ["asia-east-1", "sa-east-1"],
        "resourceGroupId": "e48af6cc-095b-494c-92b1-d0c011bc9e87",
        "resourceGroupName": "Default Resource Group"
      }
    ],
    "totalCount": 1
  }
}
```

**2. Query custom images available in the `asia-east-1` region.**

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

Request：
{
  "regionId": "asia-east-1",
  "pageNum": 1,
  "pageSize": 20
}

Response：
{
  "requestId": "TD67947F8-9B29-451F-9965-58AEDB4E5B7C",
  "response": {
    "requestId": "TD67947F8-9B29-451F-9965-58AEDB4E5B7C",
    "dataSet": [
      {
        "imageId": "img-xxxxxxxx",
        "imageName": "my-custom-image",
        "imageType": "CUSTOM_IMAGE",
        "imageSource": "CUSTOM",
        "imageSize": "40",
        "imageDescription": null,
        "imageVersion": "Server 22.04 LTS",
        "imageStatus": "AVAILABLE",
        "nicNetworkType": ["FailOver","VirtioOnly"],
        "category": "Ubuntu",
        "osType": "linux",
        "tags": null,
        "regionIdList": ["asia-east-1", "sa-east-1"],
        "resourceGroupId": "e48af6cc-095b-494c-92b1-d0c011bc9e87",
        "resourceGroupName": "Default Resource Group"
      }
    ],
    "totalCount": 1
  }
}
```

{% 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                                 |
| ---------------- | --------------------------- | ------------------------------------------- |
| 404              | INVALID\_REGION\_NOT\_FOUND | Specified availability zone does not exist. |
