Skip to main content
POST
/
webhooks
/
on-response
Webhook - When a user responds to a question
curl --request POST \
  --url https://yourdomain.com/webhooks/on-response \
  --header 'Content-Type: application/json' \
  --data '{
  "country_code": "+57",
  "cellphone": "3161234567",
  "session_id": "1234",
  "conversation_id": "5678",
  "question": {
    "type": "closed",
    "text": "conversation-question-text",
    "answers": [
      {
        "text": "answer-text"
      }
    ]
  },
  "sent_at": "2019-01-01 00:00:00",
  "responded_at": "2019-01-01 00:00:00",
  "sent_text": "text-sent-to-user",
  "actual_response": "Yes I need it",
  "classified_answer": {
    "text": "answer-text"
  },
  "user_session_keys": [
    {
      "key": "name",
      "value": "John",
      "type": null
    },
    {
      "key": "user_id",
      "value": "12345",
      "type": null
    },
    {
      "key": "loc",
      "value": "{\"latitude\": 4.5935443, \"longitude\": -72.0345404, \"address\": \"Carrera 7 #100-06\"}",
      "type": "location"
    }
  ]
}'
{}

Body

application/json

Information of the response event

Event that is triggered when a user responds to a question in 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
string
required

ID of the conversation

question
object
required
sent_at
string<date-time>
required

Date and time when the question was sent

responded_at
string<date-time>
required

Date and time when the user responded to the question

sent_text
string
required

Text sent to the user

actual_response
string
required

Literal response provided by the user

classified_answer
object
required

Classified answer based on the user's response

user_session_keys
object[]
required

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