Skip to main content

Overview

Contextual replies allow you to respond to specific messages, creating clear conversation threads by referencing previous messages. This feature enhances the user experience by providing context and maintaining organized conversations.

Key Features

  • Message Threading: Reply to any specific message with context
  • All Message Types: Use contextual replies with text, media, interactive, and all other message types
  • Convenience Methods: Dedicated reply methods for each message type
  • Backward Compatibility: All existing send methods now support reply context

How Contextual Replies Work

When you send a contextual reply, WhatsApp displays the original message above your response, making it clear which message you’re responding to. This is especially useful in group conversations or when responding to older messages. Visual Example:

Base Message Interface

All messages now extend the BaseMessage interface which includes optional context:

Reply Methods

Primary Reply Method

Convenience Methods by Message Type

Usage Examples

Basic Text Reply

Reply with Media

Reply with Interactive Elements

Using Context in Existing Send Methods

All existing sendX methods now accept an optional replyToMessageId parameter:

Webhook Integration

Contextual replies work seamlessly with webhooks for automated responses:

Advanced Use Cases

Smart Customer Service

Conversation Threading

Message Context Structure

When sending contextual replies, the message structure includes:

Best Practices

1. Choose Appropriate Context

2. Maintain Conversation Flow

3. Error Handling

Limitations

  • Message Age: You can only reply to messages sent within the last 30 days
  • Message Existence: The original message must still exist in the conversation
  • Rate Limits: Contextual replies count toward your messaging rate limits
  • Template Messages: Template messages cannot be sent as contextual replies

Migration Guide

From Regular Messages to Contextual Replies

Updating Webhook Handlers

Next Steps

Message Reactions

Learn about reacting to messages with emojis

Interactive Messages

Explore buttons and lists for user engagement

Webhook System

Set up automated contextual responses

API Reference

View complete method documentation