For AI agents: markdown of this page — /docs-content-en/entities/catalog-products/images-delete.md documentation index — /llms.txt

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
ParameterproductId (path) Typenumber Requiredyes DescriptionProduct ID. List: GET /v1/catalog-products. The ID of an SKU from GET /v1/catalog-skus, an offer from GET /v1/catalog-offers or a service from GET /v1/catalog-services also works
ParameterimageId (path) Typenumber Requiredyes DescriptionImage ID. List: GET /v1/catalog-products/:productId/images

Examples

curl — personal key

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

curl — OAuth application

Terminal
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
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata.deleted Typeboolean DescriptionAlways 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
HTTP400 CodeINVALID_PARAMS DescriptionproductId is not a canonical positive integer — for example, abc, 0 or a value outside the JavaScript safe integer range
HTTP400 CodeINVALID_PARAMS DescriptionimageId is not a canonical positive integer
HTTP404 CodeENTITY_NOT_FOUND DescriptionThe 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
HTTP404 CodeENTITY_NOT_FOUND DescriptionNo product with this productId exists
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 is unavailable or returned a response that failed the shape and safety checks
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header is missing
HTTP401 CodeINVALID_API_KEY DescriptionThe key is invalid
HTTP401 CodeTOKEN_MISSING DescriptionThe key has no Bitrix24 tokens
HTTP403 CodeSCOPE_DENIED DescriptionThe key does not have the catalog scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is read-only. Uploads and deletes require a write-enabled key
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionBitrix24 denied access to the catalog
HTTP429 CodeRATE_LIMITED DescriptionThe request limit was reached. Retry after the time in the Retry-After header
HTTP429 CodeOPERATION_TIME_LIMIT DescriptionThe Bitrix24 operation-time limit was reached. Retry after the time in the Retry-After header
HTTP503 CodeBITRIX_TIMEOUT DescriptionBitrix24 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.

Known specifics

  • Lost response. Deleting an absent image again returns 404 ENTITY_NOT_FOUND. Check the product image 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