Deleting a product attachment in Zoho Desk is done via a single DELETE API call that targets the specific product and attachment by their respective IDs. This article walks you through the endpoint, required parameters, and a ready-to-use Python snippet.
Why this matters
When managing your product catalogue in Zoho Desk, outdated or incorrect files attached to a product record can cause confusion for agents and customers alike. Removing stale attachments programmatically is essential for teams that automate catalogue maintenance or integrate Zoho Desk with external systems. Knowing the correct endpoint also helps you avoid accidentally deleting attachments from tickets, tasks, or other record types — each of which uses a different API path.
> Note: Beam Help is an independent expert support resource, not official Zoho support.
---
Step-by-step
Step 1. Identify your productId and attachmentId.
Before making any API call, you need two pieces of information: the unique identifier of the product record (productId) and the unique identifier of the file attached to it (attachmentId). Both are strings. You can retrieve these from the Zoho Desk UI or by querying the products API first. [1]
Step 2. Construct the DELETE request.
The endpoint for removing a product attachment follows this pattern:
DELETE /api/v1/products/{productId}/attachments/{attachmentId}
Replace {productId} and {attachmentId} with the actual string values you collected in Step 1. [1]
Step 3. Authenticate and send the request.
Zoho Desk's API requires a valid OAuth 2.0 token in the Authorization header. Once your token is in place, issue the DELETE request. No request body is needed — the resource is fully identified by the URL path. [1]
Step 4. Use the Python helper (optional).
If your integration is Python-based, the call maps to the deleteanattachment method shown below. Pass your IDs as strings, and optionally supply a p dictionary for any additional query parameters your setup requires: [1]
def delete_an_attachment(self, productId: str, attachmentId: str, p: dict = None):
"""Delete an Attachment from a product record"""
return self.c.request(
"DELETE",
f"/api/v1/products/{productId}/attachments/{attachmentId}",
p,
None
)
Call it like this:
result = client.delete_an_attachment(
productId="123456789",
attachmentId="987654321"
)
Step 5. Confirm the deletion.
A successful response will typically return an HTTP 200 or 204 status with no body, indicating the attachment has been removed. If you receive an error, check the troubleshooting section below. [1]
---
Common pitfalls
- Wrong endpoint for the record type. Zoho Desk exposes separate attachment-deletion endpoints for tickets (
/api/v1/tickets/{ticketId}/attachments/{attachmentId}), accounts (/api/v1/accounts/{accountId}/attachments/{attachmentId}), tasks (/api/v1/tasks/{taskId}/attachments/{attachmentId}), ticket threads (/api/v1/tickets/{ticketid}/threads/{threadid}/attachments/{attachment_id}), ticket transition drafts, and Help Center articles. [^2,3,4,5,6,7,8] Using a ticket attachment endpoint against a product ID — or vice versa — will result in a resource-not-found error. Always confirm you are targeting/api/v1/products/…when working with product records. [1]
- Swapped IDs. The
productIdandattachmentIdmust appear in the correct positions in the URL path. Reversing them will cause the request to fail or, in the worst case, target an unintended resource. [1]
- Stale or missing OAuth token. The
DELETEverb requires the same authenticated session as any other Zoho Desk API call. Ensure your token has not expired and that the associated OAuth scope covers product record management. [1]
---
What to check
- Correct path segments: Verify the URL reads
/api/v1/products/{productId}/attachments/{attachmentId}— not a ticket, task, or account variant — before executing the call. [1] - Valid IDs: Confirm both
productIdandattachmentIdexist in your Zoho Desk portal by cross-referencing them against the product record in the UI or via a prior GET request. [1] - HTTP response status: A
200or204response confirms success; a404means one or both IDs were not found, and a401/403points to an authentication or permissions issue. [1]