Beam Help
Get help now

How-to · Zoho DESK

How to delete thread attachments in Zoho Desk

Remove files from ticket conversation threads programmatically.

Deleting a thread attachment in Zoho Desk via the API requires a DELETE request that targets the specific attachment within a ticket's thread, using three path parameters to precisely identify the resource.


Why this matters


When building integrations or automation workflows on top of Zoho Desk, you may need to programmatically remove attachments from ticket threads — for example, to strip sensitive files after processing, enforce data-retention policies, or clean up test data. Knowing the correct endpoint and parameter structure prevents accidental deletion of the wrong resource. This guide covers the thread-scoped endpoint specifically, and also notes the related ticket-level variant for completeness. As always, Beam Help is independent expert support for Zoho — we are not official Zoho support.


Step-by-step


Step 1. Gather the three required identifiers before making any API call: the ticketid of the parent ticket, the threadid of the specific thread that contains the attachment, and the attachment_id of the file you want to remove. All three must be present in the request path — omitting any one of them will target a different resource or return an error. [1]


Step 2. Construct your DELETE request to the thread-attachment endpoint. The full path follows this pattern:


DELETE /api/v1/tickets/{ticket_id}/threads/{thread_id}/attachments/{attachment_id}

Replace each placeholder with the actual string IDs you collected in Step 1. [1]


Step 3. Send the request using your preferred HTTP client or the Zoho Desk SDK wrapper. In Python, the call looks like this:


response = client.delete_attachment(
    ticket_id="your_ticket_id",
    thread_id="your_thread_id",
    attachment_id="your_attachment_id"
)

The method issues a DELETE to the constructed URL and returns the API response object. [1]


Step 4. Check the HTTP response status. A successful deletion typically returns a 2xx status code. If you receive a 4xx response, revisit the IDs you supplied — a mismatch between the threadid and the ticketid is a common source of 404 errors.


Step 5. If your use case involves removing an attachment that belongs to the ticket itself rather than to a specific thread, use the ticket-level endpoint instead:


DELETE /api/v1/tickets/{ticketId}/attachments/{attachmentId}

This variant only requires ticketId and attachmentId — no thread_id is needed. [7]


Common pitfalls


  • Mixing up endpoint variants. Zoho Desk exposes several attachment-deletion endpoints for different resource types: threads [1], tickets [7], tasks [3], accounts [4], products [6], Help Center articles [8], and transition drafts [5]. Using the wrong endpoint for your resource type will result in a 404 or a permissions error, even if the attachment ID is correct.

  • Incorrect path parameter order. The thread-attachment endpoint requires the parameters in the order ticketid → threadid → attachmentid. Swapping threadid and attachment_id in the URL will produce an invalid path. [1]

  • Deleting a transition-draft attachment by mistake. If a ticket is mid-transition (e.g., moving through a blueprint stage), its draft attachments live under a separate path that also requires a transitionId. Sending a standard thread-delete request will not affect those files. [5]

What to check


  • Confirm all three IDs are correct — verify that the threadid actually belongs to the ticketid you specified before firing the request. [1]
  • Verify the response status code — ensure you received a 2xx response; anything else means the attachment was not deleted and you should inspect the error body for details.
  • Confirm the right endpoint for your resource — if the attachment is on a task, account, or product rather than a ticket thread, use the corresponding endpoint (/api/v1/tasks/, /api/v1/accounts/, or /api/v1/products/) to avoid a failed or misdirected deletion. [3][4][6]

Sources cited

  1. [1] DELETE /api/v1/tickets/{ticket_id}/threads/{thread_id}/attachments/{attachment_id}
  2. [2] DELETE /api/v1/tickets/{ticket_id}/attachments/{attachment_id}
  3. [3] DELETE /api/v1/tasks/{taskId}/attachments/{attachmentId}
  4. [4] DELETE /api/v1/accounts/{accountId}/attachments/{attachmentId}
  5. [5] DELETE /api/v1/tickets/{ticketId}/transitions/{transitionId}/attachments/{attachmentId}
  6. [6] DELETE /api/v1/products/{productId}/attachments/{attachmentId}
  7. [7] DELETE /api/v1/tickets/{ticketId}/attachments/{attachmentId}
  8. [8] DELETE /api/v1/helpcenter/{helpcenter_id}/articles/{article_id}/attachments/{attachment_id}
Delete Thread Attachments | Beam Help — Beam Help