---
title: "Redact Chat Comment Attachment"
method: PUT
path: "/api/v2/chat_file_redactions/{ticket_id}"
tags: ["Ticket Comments"]
---

# Redact Chat Comment Attachment

`PUT /api/v2/chat_file_redactions/{ticket_id}`

Permanently removes one or more chat attachments from a chat ticket.

**Note**: This does not work on active chats. For chat tickets that predate March 2020, consider using [Redact Ticket Comment In Agent Workspace](#redact-ticket-comment-in-agent-workspace).

#### Allowed For

- Agents

[Agent Workspace](https://support.zendesk.com/hc/en-us/articles/360024218473) must enabled for the account. Deleting tickets must be enabled for agents.

#### Request Body Properties

| Name         | Type    | Required | Description                                                                                                                                                                                                                                            |
| ------------ | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| chat_id      | string  | true     | The `chat_id` in the `ChatStartedEvent` event in the ticket audit. See [Ticket Audits](/api-reference/ticketing/tickets/ticket_audits)                                                                                                                 |
| chat_indexes | array   | false    | The array of `chat_index` in the `ChatFileAttachment` event in the ticket audit. See [Ticket Audits](/api-reference/ticketing/tickets/ticket_audits). Mandatory if `message_ids` is not used                                                           |
| message_ids  | array   | false    | The array of `message_id` in the `ChatFileAttachment` event in the ticket audit that is part of a `ChatStartedEvent` history. Used when redacting a ChatFileAttachment that is part of a conversation history. Mandatory if `chat_indexes` is not used |

To get the required body properties, make a request to the [Ticket Audits](/api-reference/ticketing/tickets/ticket_audits) endpoint. Example response:

```http
Status 200 OK
{
  "audits": [
    "events": [
      {
        "id": 1932802680168,
        "type": "ChatStartedEvent",
        "value": {
          "visitor_id": "10502823-16EkM3T6VNq7KMd",
          "chat_id": "2109.10502823.Sjuj2YrBpXwei",
          "history": [
            {
              "chat_index": 0,
              "type": "ChatFileAttachment",
              "filename": "image1.jpg"
            },
            {
              "chat_index": 1,
              "type": "ChatFileAttachment",
              "filename": "image2.jpg"
            }
          ]
        }
      }
    ]
  ]
}
```

## Response `200`

Success response

- TicketChatCommentRedactionResponse
  - `chat_event` object — Chat event object
    - `id` integer — Id assigned to the chat event object
    - `type` string — Type of chat event
    - `value` object — The value of the chat event object
      - `chat_id` string — Id of the chat session
      - `history` object[] — Chat events within the chat session
      - `visitor_id` string — Id assigned to the visitor

---

[API](https://skmtc.dev/botbrains-io/apis/support-api.md) · [All operations](https://skmtc.dev/botbrains-io/apis/support-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/botbrains-io/support-api/revisions/d53eac07ba68/schema)
