Skip to content

Sending feedback

POST
/api/v1/ai/feedback

Initially, when an answer is rated, you should set the value of the feedback property within the chata-data history object. This value can be set to either negative or positive. Following this, proceed to call this endpoint to store the feedback. The endpoint will respond with a generated reply in the appropriate language of the conversation.

As a subsequent step, you can present this message to the user and request their email address. If you intend to forward this conversation to the configured support email address, you can simply make another call to this endpoint, setting the sendEmail property to true and including the user’s email address within the email property. Once more, this endpoint will provide a generated response that you can display to the user.

x-api-key
required
string

Your API key from account settings.

object
chatDataJson
required

Use the returned chat-data object from the query to render the answer. Then when an answer received negative feedback (for example using a thumbs-down button), you can set the feedback property to the value negative for that rated answer. You must always supply this chat-data object submitting feedback.

string
accountId
required
apiKey
required
websiteId
required

The website ID you trained the AI on.

string
visitorId
required

An unique identifier for your visitor.

string
feedback
required

Can be ‘negative’, ‘positive’, ‘escalated’ or ‘note’.

string
Allowed values: negative positive escalated note
object
conversationId
string
sender
string
message
string
type

When requireEmail, the UI should prompt the visitor for their email to escalate the conversation.

string
Example
{
"conversationId": "d35f69a04d7b252b25f0186b2524e517f96704cc78da7e38a29ab8b92be41617",
"sender": "bot",
"message": "I'm sorry to hear that. If you prefer to communicate with a person, kindly provide your email, and someone from support will get in touch with you.",
"type": "requireEmail"
}

Invalid request parameters.