Email callback API

Intro

We offer you the ability to send all automatic emails meant for contacts to your own server via a callback URL, instead of sending the email through our email infrastructure. By sending the emails via your own email server infrastructure or helpdesk system, you get total control over the sender identity and the return path.

Enable email callback URL

  1. Go to the email callback API settings under **Chat > Advanced**.
  2. Check the **Custom email API** box

Request documentation

TypeValueDescription
Request MethodPOST
Request HeaderAPI-SECURITY-TOKENContains your custom security token
Request BodyJSON

JSON body

NameTypeDescription
htmlStringHTML version of the email body
receiverStringEmail address of the recipient
subjectStringSubject of the email
textStringRaw text email
email_typeStringThe type of email Userlike sends, it’s either "transcript" or "reauth"
contextStringImportant information that the email contains. Each email_type has its own context, scroll down to **Transcript context** and **Reauth context** to learn more

An example of a message object:

Transcript context

Transcript emails contain all messages sent during a Conversation as well as survey answers, feedback, ratings and other Conversation events. Their email_type is set to "transcript".

NameTypeDescription
messagesArrayAn array of all messages sent during a Conversation. Each message is an object

An example of a message object:

Reauth context

Reauth emails contain a link and a token with which contacts can authenticate themselves.

NameTypeDescription
reauth_linkStringA link that authenticates your contacts when they click on it. Note that the link can be missing if no inbound URL is defined in the Widget’s settings.
reauth_tokenStringA token that contacts can enter in the Widget to authenticate, for example when no reauth link is displayed