> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voyantcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Product Media

> Remove a media item using its ID, asset reference, or URL.

## Method

`DELETE` `/v1/products/:id/media`

## Path Parameters

<ParamField path="id" type="uuid" required>Product ID.</ParamField>

## Query Parameters

<ParamField query="mediaId" type="string">Media ID to delete.</ParamField>
<ParamField query="assetId" type="string">Gallery asset ID to delete.</ParamField>
<ParamField query="url" type="string">Media URL to delete.</ParamField>

You may also send these identifiers in the JSON request body. At least one identifier is required.

## Headers

<ParamField header="Authorization" type="string">Bearer token (requires `products:write`).</ParamField>
<ParamField header="content-type" type="string">`application/json` (optional if using query parameters).</ParamField>

## Request Example

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE "https://api.voyantcloud.com/v1/products/prod_123/media?mediaId=media_01J0E6V4ZBAVQ9PQJRTR6K9HQC" \
    -H "Authorization: Bearer $VOYANT_API_KEY"
  ```

  ```javascript Node.js theme={null}
  await fetch("https://api.voyantcloud.com/v1/products/prod_123/media", {
    method: "DELETE",
    headers: {
      Authorization: `Bearer ${process.env.VOYANT_API_KEY}`,
      "content-type": "application/json",
    },
    body: JSON.stringify({ assetId: "asset_01HZY8SM9P8K4B8N7Q" }),
  })
  ```

  ```python Python theme={null}
  import os, requests

  requests.delete(
    "https://api.voyantcloud.com/v1/products/prod_123/media",
    headers={
      "Authorization": f"Bearer {os.environ['VOYANT_API_KEY']}",
      "content-type": "application/json",
    },
    json={"url": "https://cdn.voyantcloud.com/media/prod_123/gallery-1.jpg"},
  )
  ```
</RequestExample>

## Response Example

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "data": {
      "id": "media_01J0E6V4ZBAVQ9PQJRTR6K9HQC",
      "deleted": true
    }
  }
  ```

  ```json 400 Bad Request theme={null}
  { "error": "One of mediaId, assetId, or url is required" }
  ```

  ```json 404 Not Found theme={null}
  { "error": "Media not found" }
  ```
</ResponseExample>

<Warning>
  The API validates workspace ownership before deletion (`ProductOwnershipError`). Ensure the media item belongs to the requesting workspace.
</Warning>
