Beam Help
Get help now

How-to · Zoho DESK

How to delete task comments in Zoho Desk

Remove comments from support tasks programmatically.

Deleting a task comment in Zoho Desk is done via a single authenticated DELETE API call that targets the specific task and comment by their respective IDs.


Why this matters


When managing support workflows in Zoho Desk, task comments can accumulate outdated notes, test entries, or sensitive information that should be removed. Knowing how to programmatically delete these comments is essential for teams building automations, running cleanup scripts, or integrating Zoho Desk with external systems. This is especially relevant if you manage Desk data at scale and need precise control over task records. *(Note: Beam Help is independent expert support for Zoho — we are not official Zoho support.)*


---


Step-by-step


Step 1. Ensure your OAuth token includes the correct Zoho Desk scope for task operations. The required scope for deleting task-related data is Desk.tasks.DELETE (or the broader Desk.tasks.ALL). Without this scope present in your token, the API will reject the request. [2]


Step 2. Identify the two required path parameters you will need before making the call:


  • taskId — the unique identifier of the task that contains the comment.
  • commentId — the unique identifier of the specific comment you want to remove.

Both values are strings and must be passed in the request URL. [1]


Step 3. Construct and send the DELETE request to the following endpoint:


DELETE /api/v1/tasks/{taskId}/comments/{commentId}

Replace {taskId} and {commentId} with the actual IDs. No request body is required — the operation is fully described by the URL path. [1]


Step 4. If you are using a Python client, the call maps to the deletetaskcomment method. Pass the task ID and comment ID as positional string arguments. An optional p dictionary parameter is available for any additional query parameters your integration may require. [1]


result = desk_client.delete_task_comment(
    taskId="your_task_id_here",
    commentId="your_comment_id_here"
)

Step 5. Check the response from Zoho Desk. A successful deletion will return a 2xx HTTP status. If the response contains an error key, review the message to determine whether the issue is a missing scope, an invalid ID, or a permissions problem. [5]


---


Common pitfalls


  • Wrong scope: Using Desk.tasks.READ or Desk.tasks.WRITE alone is not sufficient. The delete operation specifically requires Desk.tasks.DELETE or Desk.tasks.ALL to be included in your OAuth scope list. [2]

  • Confusing task comments with ticket comments: The task comment endpoint (/api/v1/tasks/{taskId}/comments/{commentId}) is distinct from the ticket comment endpoint (/api/v1/tickets/{ticketid}/comments/{commentid}). Sending a task's comment ID to the ticket endpoint — or vice versa — will result in a not-found error. [1][6]

  • Mixing up other comment types: Zoho Desk has separate delete endpoints for call comments (/api/v1/calls/{callId}/comments/{commentId}), contact comments (/api/v1/contacts/{contactId}/comments/{commentId}), and contract comments (/api/v1/contracts/{contractId}/comments/{commentId}). Make sure you are targeting the task-specific route. [3][4][7]

  • Incorrect ID types: Both taskId and commentId must be passed as strings, not integers, even if they appear numeric. [1]

---


What to check


  • Scope verification: Confirm that Desk.tasks.DELETE or Desk.tasks.ALL is present in the OAuth scopes used to generate your access token. [2]
  • Correct endpoint path: Double-check that your request URL uses /api/v1/tasks/ and not a ticket, call, or contact variant of the comments endpoint. [1][6]
  • Response status: Verify that the API returns a 2xx status code; if an error object is returned instead, inspect the message field for actionable detail. [5]

Sources cited

  1. [1] DELETE /api/v1/tasks/{taskId}/comments/{commentId}
  2. [2] config.py
  3. [3] DELETE /api/v1/contracts/{contractId}/comments/{commentId}
  4. [4] DELETE /api/v1/contacts/{contactId}/comments/{commentId}
  5. [5] server.py: apply_plan
  6. [6] DELETE /api/v1/tickets/{ticket_id}/comments/{comment_id}
  7. [7] DELETE /api/v1/calls/{callId}/comments/{commentId}
  8. [8] server.py: chat_plan_stream
Delete Task Comments | Beam Help — Beam Help