Question
How can I redact attachments on closed tickets with the API?
Answer
You can redact attachments on closed tickets using the Redact Ticket Comment endpoint and including the external_attachment_urls
property in the request body.
To redact attachments from closed tickets
- Use the List Audits for a Ticket endpoint on the closed ticket id to get the following attachment information (see screenshot below):
- 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 obtained from Step 1 above.
Include the content URL from Step 1 in thehtml_body
. In Postman, the format is:{ "external_attachment_urls": ["content_url"], "ticket_id": {ticket_id} }
where
external_attachment_urls
is an array of attachment URLs belonging to the comment to be redacted.
Example:
The attachment will be redacted after a successful API call:
For more information, see the article: Redacting ticket content.