## Delete product image

`DELETE /v1/catalog-products/:productId/images/:imageId`

Deletes one catalog product image. A deleted image cannot be restored through the API — upload it again.

## Parameters

| Parameter | Type | Required | Description |
|-----------|------|:--------:|-------------|
| `productId` (path) | number | yes | Product ID. List: [`GET /v1/catalog-products`](/docs/entities/catalog-products/list). The ID of an SKU from [`GET /v1/catalog-skus`](/docs/entities/catalog-skus/list), an offer from [`GET /v1/catalog-offers`](/docs/entities/catalog-offers/list) or a service from [`GET /v1/catalog-services`](/docs/entities/catalog-services/list) also works |
| `imageId` (path) | number | yes | Image ID. List: [`GET /v1/catalog-products/:productId/images`](/docs/entities/catalog-products/images-list) |

## Examples

### curl — personal key

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/catalog-products/7257/images/38993" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl -X DELETE "https://vibecode.bitrix24.com/v1/catalog-products/7257/images/38993" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/catalog-products/7257/images/38993', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
})

const { success, data } = await res.json()
console.log('Deleted:', data.deleted)
```

### JavaScript — OAuth application

```javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/catalog-products/7257/images/38993', {
  method: 'DELETE',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
})

const { success, data } = await res.json()
```

## Response fields

| Field | Type | Description |
|-------|------|-------------|
| `success` | boolean | Always `true` on success |
| `data.deleted` | boolean | Always `true`: the image was deleted |

## Response example

```json
{
  "success": true,
  "data": {
    "deleted": true
  }
}
```

## Error response example

404 — the product has no image with this `imageId`, for example because it was already deleted:

```json
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Catalog product image not found"
  }
}
```

## Errors

| HTTP | Code | Description |
|------|------|-------------|
| 400 | `INVALID_PARAMS` | `productId` is not a canonical positive integer — for example, `abc`, `0` or a value outside the JavaScript safe integer range |
| 400 | `INVALID_PARAMS` | `imageId` is not a canonical positive integer |
| 404 | `ENTITY_NOT_FOUND` | The product has no image with this `imageId`: it was already deleted, belongs to another product or does not exist. An image of another product is not deleted |
| 404 | `ENTITY_NOT_FOUND` | No product with this `productId` exists |
| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable or returned a response that failed the shape and safety checks |
| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |
| 401 | `INVALID_API_KEY` | The key is invalid |
| 401 | `TOKEN_MISSING` | The key has no Bitrix24 tokens |
| 403 | `SCOPE_DENIED` | The key does not have the `catalog` scope |
| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only. Uploads and deletes require a write-enabled key |
| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied access to the catalog |
| 429 | `RATE_LIMITED` | The request limit was reached. Retry after the time in the `Retry-After` header |
| 429 | `OPERATION_TIME_LIMIT` | The Bitrix24 operation-time limit was reached. Retry after the time in the `Retry-After` header |
| 503 | `BITRIX_TIMEOUT` | Bitrix24 did not respond in time, so the write outcome is unknown. Check the product image list before retrying |

Full list of common API errors — [Errors](/docs/errors).

## Known specifics

- **Lost response.** Deleting an absent image again returns `404 ENTITY_NOT_FOUND`. Check the [product image list](/docs/entities/catalog-products/images-list). An image's absence from the list does not establish whether it was deleted by this request, by another request or was absent from the start.

## See also

- [Product images](/docs/entities/catalog-products/images)
- [Upload product image](/docs/entities/catalog-products/images-create)
- [List product images](/docs/entities/catalog-products/images-list)
- [Get product image](/docs/entities/catalog-products/images-get)
- [Catalog products](/docs/entities/catalog-products)
