Skip to main content
POST
/
webhooks
/
on-optout
Webhook - When a user opts out
curl --request POST \
  --url https://yourdomain.com/webhooks/on-optout \
  --header 'Content-Type: application/json' \
  --data '{
  "country_code": "+57",
  "cellphone": "3176477608",
  "session_id": "85b398ef5bcb20c355f3710c4509349784c907673c9118fb7a89c7a8",
  "conversation_id": 54263,
  "question": {
    "type": "closed",
    "text": "Hi! Thanks for attending our webinar today. We would like to have a feedback about our session and we would be very grateful if you could help us with that. ",
    "answers": [
      {
        "text": "Sure"
      },
      {
        "text": "No, thanks"
      },
      {
        "text": "DEFAULT"
      }
    ]
  },
  "sent_at": "2021-10-22 00:15:39.044704",
  "sent_text": "Hi! Thanks for attending our webinar today. We would like to have a feedback about our session and we would be very grateful if you could help us with that. \n1) Sure\n2) No, thanks\n3) DEFAULT",
  "user_session_keys": [],
  "classified_answer": {
    "text": "No, thanks"
  },
  "reason": "OPTOUT"
}'
{}

Body

application/json

Information of the opt-out event

Event that is triggered when a user decides to opt out or exit the conversation

country_code
string
required

Country code of the user

cellphone
string
required

User's phone number without the country code

session_id
string
required

ID of the user's session

conversation_id
integer
required

ID of the conversation

question
object
required
sent_at
string<date-time>
required

Date and time when the question was sent

sent_text
string
required

Text sent to the user

classified_answer
object
required

Classified answer based on the user's response

reason
enum<string>
required

Reason for the user's exit, in this case 'OPTOUT' to indicate that the user decided to opt out

Available options:
OPTOUT
user_session_keys
object[]

User session keys collected during the conversation or provided during the deployment

Response

200 - application/json

Response to update or add information to the session

JSON object with the new information that will be replaced or added to the session for future use. The service must respond in less than 10 seconds.

I