---
title: "Edit an existing task comment (body + attachments). Author-only. Internal-note flag,
reply-to context, identity, and DateCreated are locked. Edits are silent (no new comment
notification re-fires); only NEWLY-added @mentions trigger their mention notification."
method: PUT
path: "/api/TaskDiscussion"
tags: ["TaskDiscussion"]
---

# Edit an existing task comment (body + attachments). Author-only. Internal-note flag,
reply-to context, identity, and DateCreated are locked. Edits are silent (no new comment
notification re-fires); only NEWLY-added @mentions trigger their mention notification.

`PUT /api/TaskDiscussion`

FileAttachmentIDs is the FINAL canonical attachment set after edit — both previously
linked IDs to keep and newly uploaded Draft IDs to add. Existing attachments not
included are hard-deleted (S3 blob + DB row). Optimistic concurrency: pass
ExpectedDateUpdated equal to the row's last-known DateUpdated to get a 409 on conflict.

## Request body

- EditTaskDiscussion
  - `TaskResponseID` integer — The TaskResponseID of the comment to edit. Must be authored by the current user.
  - `ResponseBody` string — The new message body. Required (non-empty after sanitisation) if FileAttachmentIDs is empty. @mention markup is the same as on POST: &lt;span class="mention" data-mentionid="12345"&gt;@Firstname Lastname&lt;/span&gt; (the class attribute is required). On edit, only NEWLY-added mentions are notified/followed; mentions already present before the edit are not re-notified.
  - `FileAttachmentIDs` integer[] — Final canonical attachment set after edit: existing IDs to KEEP plus new draft IDs to ADD. Existing IDs omitted from this list are hard-deleted. Maximum 8.
  - `ExpectedDateUpdated` string, date-time — Optional optimistic-concurrency guard. If supplied and differs from the row's current DateUpdated, the edit is rejected with 409.

## Response `200`

OK

- TaskDiscussionResponse — A single message in a task discussion, including author, body text, timestamps, attachments, and reply context.
  - `TaskResponseID` integer — Unique identifier for this discussion message.
  - `CreatedByName` string — Display name of the message author.
  - `isActive` boolean — Whether this message is active (not deleted).
  - `CreatedByUserIDFK` integer — User ID of the message author.
  - `ResponseBody` string — The message content (may contain HTML).
  - `DateCreatedString` string — Formatted creation date string.
  - `canDelete` boolean — Whether the current user can delete this message.
  - `canEdit` boolean — Whether the current user can edit this message (author + not system + active membership).
  - `attachments` TaskDiscussionResponseAttachment[] — List of file attachments on this message.
    - `FileAttachmentID` integer — Unique identifier for the file attachment.
    - `Filename` string — Storage filename of the attachment.
    - `DateCreatedString` string — Formatted creation date of the attachment.
    - `provider` string — Storage provider code for the attachment.
    - `FileExtension` string — File extension (e.g. '.pdf', '.png').
    - `PublicFileURL` string — Public URL to download the attachment.
    - `PreviewURL` string — URL for a preview/thumbnail of the attachment.
    - `CanPreview` boolean — Whether a preview is available for this attachment.
    - `Type` string — MIME type or category of the attachment.
    - `URL` string — Direct URL to the attachment.
    - `Preview` string — Preview image URL.
    - `Name` string — Attachment name.
    - `Size` string — File size in human-readable format.
  - `isInternalNote` boolean — Whether this is an internal note (not visible to external contacts).
  - `Unread` string — Whether this message is unread by the current user.
  - `isSystem` boolean — Whether this is a system-generated message (e.g. status change notification).
  - `isEdited` boolean — True if the author has edited this message after posting; drives the (edited) UI indicator.
  - `DateLastEditedUtc` string, date-time — Timestamp (UTC) of the most recent user edit. Null if never edited. Distinct from DateUpdated.
  - `ReplyToMessageID` integer — The message ID this is a reply to, if any.
  - `ReplyToDateCreated` string, date-time — Creation date of the message being replied to.
  - `ReplyToCreatedByUserIDFK` integer — User ID of the author of the message being replied to.
  - `ReplyToUserName` string — Author name of the message being replied to.
  - `ReplyToBody` string — Body of the message being replied to.
  - `ReplyToFileID1` integer
  - `ReplyToFilePreview1` string
  - `ReplyToFileProvider1` string
  - `ReplyToFileName1` string
  - `ReplyToFileType1` string

---

[API](https://skmtc.net/avaza/apis/avaza-api-documentation.md) · [All operations](https://skmtc.net/avaza/apis/avaza-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/avaza/avaza-api-documentation/versions/1eeadf750514/schema)
