Question

I have a large number of closed tickets that I want to delete. How do I bulk delete closed tickets?

Answer

You can't delete closed tickets from views or profiles. Instead, use one of these options:

  • Create a deletion schedule and delete archived tickets after a specified period of time
  • If you have developers, delete closed tickets with the application programming interface (API) and the Bulk Delete Tickets endpoint
  • Use third-party apps from the Marketplace

    Disclaimer: Zendesk Customer Support doesn't support third-party apps and the API. For more information, see:

    • Where can I receive help with third-party apps on the Marketplace?
    • How can I receive support for custom scripts that use Zendesk APIs?

Use the API

To bulk delete tickets programmatically:

Bulk delete tickets API

Endpoint:

DELETE /api/v2/tickets/destroy_many?ids={comma_separated_ids}

Example:

bash
curl https://yoursubdomain.zendesk.com/api/v2/tickets/destroy_many?ids=123,456,789 \
 -u your_email@example.com/token:your_api_token \
 -X DELETE

Limits

  • Maximum 100 tickets per request
  • Tickets must be closed for 24 or more hours
  • Standard API rate limits of 400 requests per minute apply

Python example

import requests

subdomain = 'your-subdomain'
email = 'your-email@example.com'
api_token = 'your-api-token'

ticket_ids = [123, 456, 789]  # IDs to delete
ids_param = ','.join(map(str, ticket_ids))

url = f'https://{subdomain}.zendesk.com/api/v2/tickets/destroy_many'
response = requests.delete(
    url,
    params={'ids': ids_param},
    auth=(f'{email}/token', api_token)
)

if response.status_code == 200:
    print(f'Deleted {len(ticket_ids)} tickets')

Documentation

  • Bulk Delete Tickets API
  • API authentication guide
  • Automated Data Privacy Partner (ADPP)
  • Available Deletion Conditions

If you have the Advanced Data Privacy and Protection (ADPP) add-on, you can create multiple ticket deletion schedules to automatically delete specific types of tickets. You can use a variety of conditions, such as:

  • Brand
  • Organization
  • Tags
  • Custom fields
  • Status
  • Form
  • Group
  • Attachment

The Attachment condition allows you to:

  • Delete only tickets that include attachments
  • Keep tickets without attachments
  • Combine the attachment condition with other filters for tailored deletion rules

Important limitation for Messaging attachments

The "Attachments present" condition doesn't detect attachments in messaging conversations. Messaging conversations store attachments in a different data model than traditional tickets, which the deletion scheduler doesn't detect.

Impact:

  • Deletion rules with "Attachments present" can delete messaging tickets with attachments
  • Only traditional email or web ticket attachments are detected
  • This is a known product limitation

Why this matters:

  • If you use deletion rules such as Tickets | without attachments | after 30 days:
  • Preserves email or web tickets with attachments
  • May delete messaging tickets with attachments because the scheduler doesn't detect them

Workaround

To exclude messaging tickets, add this condition:

Ticket channel | Is not | Messaging

Or create a separate deletion schedule for messaging tickets without the attachment condition.

For questions about ADPP capabilities, contact Zendesk Customer Support for further help or contact your account representative.

Powered by Zendesk