Question

How can I redact attachments on closed tickets with the API?

Answer

Use the Redact Ticket Comment endpoint to redact attachments on closed tickets. Include the external_attachment_urls property in the request body.

Note: The Redact Comment Attachment endpoint doesn't apply to closed tickets.

To redact attachments from closed tickets:

Use the List Audits for a Ticket endpoint for the closed ticket ID to get:

comment ID

content URL

Call PUT "https://yoursubdomain.zendesk.com/api/v2/comment_redactions/
{ticket_comment_id} from Postman or curl.

Replace {yoursubdomain} with your account subdomain and {ticket_comment_id} with the comment ID from step 1.

Include the content URL from step 1 in the external_attachment_urls array. In Postman, use this format:

{ "external_attachment_urls": ["content_url"], "ticket_id": {ticket_id} }

where external_attachment_urls is an array of attachment URLs for the comment you redact.

Example:

The attachment is redacted after a successful API call:

Note: Ticket redaction works on content in archived or closed tickets for email, API, and web form channels. Ticket redaction doesn't work on content in archived or closed tickets for messaging and live chat channels. Private attachments are also available in messaging tickets for end users and ticket assignees. These attachments provide a higher level of security and users have limited access to these types of attachments. To check if you use this setting, navigate to Admin Center > Objects and rules > Tickets > Settings > Downloads and attachments and check Allow secure downloads.

For more information, see Redacting ticket content. As a workaround, you can also set an attachment expiration time for your ticket attachments to allow end users access for a specific timeframe.