> 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/image/deleteimagecopy.md).

# DeleteImageCopy

## 1. API Description

This API (DeleteImageCopy) is used to delete regional replicated images.

{% hint style="info" %}
Delete the replicas of a custom image in the specified regions, keeping at least one available region. Replicas can be deleted only when the image is in the available status (statuses such as replicating return INVALID\_IMAGE\_STATUS).
{% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type            | Description                                                                                                                                                                       |
| -------------- | -------- | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| imageId        | Yes      | String          | <p>Custom image ID.</p><p>It can be obtained by calling <a href="/api-reference/zec/image/describeimages.md">DescribeImages</a>.</p>                                              |
| regionIds      | Yes      | Array of String | <p>ID list of the regions whose replicas are to be deleted.</p><p>It can be obtained by calling <a href="/api-reference/zec/location/describeregions.md">DescribeRegions</a>.</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> |

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**1. Delete the image replicas in the specified regions.**

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

Request：
{
  "imageId": "<custom image id>",
  "regionIds": ["region-a", "region-b"]
}
```

{% 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\_IMAGE\_NOT\_FOUND        | Image not found.                                   |
| 400              | INVALID\_IMAGE\_STATUS            | The image's state does not support this operation. |
| 404              | INVALID\_IMAGE\_COPY\_NOT\_FOUND  | Regional replicated image does not exist.          |
| 400              | INVALID\_IMAGE\_REGION\_ONLY\_ONE | Keep at least one regional replica.                |
| 404              | INVALID\_REGION\_NOT\_FOUND       | The specified region does not exist.               |
