Skip to main content

Suggested Replies

Suggested Replies allow you to add predefined responses to conversation messages, thus improving the response time and the overall communication experience.

Suggested Replies are text replies that you can add to any message via the HTTP API. The suggested replies of the last 5 messages of a given conversation are considered for suggestion.

As soon as suggested replies have been successfully added to a message (i.e. the API request returned a 200 response), a Suggestions button appears at the top left of the input in the messages list of the conversation's UI, enabling the user to choose a suggested reply as an answer.

The screenshot below shows a sample conversation in the UI of an Airy Core instance: two suggested replies have been added to the contact's last message ('Great that it worked. Is there anything else you need?' and 'Have a nice day!'). The user clicks on the Suggestions button at the top left of the conversation's input and selects the suggested reply 'Have a nice day!'.

suggestedReplies

API request to add suggested replies

Suggest replies endpoint

Send suggested replies to your Airy Core instance through the messages.suggestReplies endpoint


POST /messages.suggest-replies

Suggest a set of replies for a given message ID. UI clients can then show these replies to agents to help them respond to user inquiries.

Sample request

{
"message_id": "uuid",
"suggestions": {
"suggestion-id-1": {
"content": {"text": "Great that it worked. Is there anything else you need?"},
},
"suggestion-id-2": {
"content": {"text": "Have a nice day!"},
},
},
}

Sample response

The updated message including the suggested replies.

{
"id": "{UUID}",
"content": {"text": "Hello World"},
"state": "{String}",
"from_contact": true,
"sent_at": "{string}",
"source": "{String}",
"metadata": {
"suggestions": {
"suggestion-id-1": {
"content": {"text": "Great that it worked. Is there anything else you need?"},
// source specific content field (same as message content)
},
"suggestion-id-2": {
"content": {"text": "Have a nice day!"},
},
},
},
// metadata object of the message including the reply suggestions
}