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

# DeleteImageCopy

## 1. API Description

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

{% hint style="info" %}
Keep at least one regional replica. Deletion is allowed only when the image is in the Available state; otherwise (e.g., during replication), an INVALID\_IMAGE\_STATUS error will be returned.
{% endhint %}

## 2. Input Parameters

The following request parameter list only provides API request parameters.

| Parameter Name | Required | Type            | Description                          |
| -------------- | -------- | --------------- | ------------------------------------ |
| imageId        | Yes      | String          | Custom image ID.                     |
| regionIds      | Yes      | Array of String | Region ID list of regional replicas. |

## 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" %}
**Delete regional replicated images.**

```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"]
}


  Response：
  {
    "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3",
    "response": {
      "requestId": "T05992D0C-7E8B-4047-B0C0-780F2CD549D3"
    }
  }
```

{% 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       | Specified availability zone does not exist.        |
