Threaded Conversations: Message replies create structured conversation threads that help organize discussions and maintain context. Users can reply to any message type with any content type, creating rich threaded interactions.

Message Replies Overview

Message replies enable threaded conversations by linking new messages to existing parent messages. This creates hierarchical discussion structures that improve conversation organization and context preservation.

Threaded Structure

Organized conversations
  • Parent-child message relationships
  • Nested conversation threads
  • Context preservation
  • Discussion continuity

Any Content Type

Flexible reply content
  • Text message replies
  • Media attachment replies
  • Custom message replies
  • Mixed content threads

Implementation Guide

Create replies to existing messagesReply to any message with text, media, or custom content by specifying the parent message ID.

Required Parameters

ParameterTypeDescription
subChannelIdStringTarget subchannel identifier for the reply message
parentIdStringParent message ID to create reply thread
dataTypeMessageContentTypeContent type (TEXT, IMAGE, VIDEO, AUDIO, FILE, CUSTOM)
dataObjectContent data specific to the message type

Optional Parameters

ParameterTypeDescription
tagsArray<String>Message categorization and filtering tags
metadataObjectAdditional properties for extended functionality
mentionsArray<String>User IDs to mention in the reply message

Code Examples

// Reply with text message
let textReplyOptions = AmityTextMessageCreateOptions(
    subChannelId: "subChannel-123",
    text: "Thanks for sharing! This is really helpful.",
    tags: ["reply", "helpful"],
    parentId: "parentMessageId",
    metadata: ["reply_type": "appreciation"],
    mentioneesBuilder: nil
)

do {
    let replyMessage = try await messageRepository.createTextMessage(options: textReplyOptions)
    print("Reply sent successfully: \(replyMessage.messageId)")
    
    // Access parent message information
    if let parentMessage = replyMessage.parentMessage {
        print("Replying to message: \(parentMessage.messageId)")
        print("Original author: \(parentMessage.creatorDisplayName ?? "Unknown")")
    }
} catch {
    print("Failed to send reply: \(error.localizedDescription)")
}
Thread Context: Reply messages automatically inherit the context of their parent message, creating organized conversation threads that preserve discussion history and improve user experience.
Threading Strategy: Start with simple reply functionality and gradually add advanced features like thread depth management and smart notifications. Monitor user behavior to optimize thread organization and navigation patterns.