Content Control: Users can only edit and delete their own messages, ensuring content ownership while maintaining conversation integrity. All modifications include audit trails with timestamps for transparency.

Message Management Overview

Edit and delete functionality provides users with control over their sent messages, allowing corrections, content updates, and removal when necessary. All operations maintain audit trails and respect permission boundaries.

Message Editing

Content modification
  • Text message updates
  • Custom message editing
  • Timestamp tracking

Message Deletion

Content removal
  • Soft delete functionality
  • Conversation continuity
  • Permission enforcement
  • Visibility control

Implementation Guide

Modify existing message content with proper trackingEdit your own messages with automatic timestamp updates and audit timestamp for transparency.

Edit Permissions

PermissionDescription
Own Messages OnlyUsers can only edit messages they created
Time WindowOptional time limits for editing (configurable)
Content TypesText and custom messages support editing
Audit TraileditedAt automatically updated on modifications

Required Parameters

ParameterTypeDescription
messageIdStringUnique identifier of the message to edit
contentString/ObjectNew content for the message (text or custom data)

Optional Parameters

ParameterTypeDescription
tagsArray<String>Updated message tags
metadataObjectAdditional properties and information

Code Examples

// Edit text message
do {
    let updated = try await messageRepository.editTextMessage(withId: message.messageId, "<Text>")
} catch {
    // Handle error here
}

// Edit custom message
do {
    let updated = try await messageRepository.editCustomMessage(withId: message.messageId, [:])
} catch {
    // Handle error here
}

Edit Tracking

PropertyTypeDescription
editedAtDateTimeTimestamp of last edit
Edit Indicator: When a message is edited, the editedAt is automatically set to the current time, allowing your UI to display edit indicators to inform users when content has been modified.

Permission Management

Implementation Strategy: Start with basic edit and delete functionality, then progressively add advanced features like edit history, undo options, and comprehensive validation. Always prioritize user experience and provide clear feedback for all operations.