Create a new webhook

Types of events supported: "new_call", "new_voicemail", "new_sms", "inbound_call_answered", "inbound_call_ended", "outbound_call", "outbound_call_ended"

Call related events sent this data:

NameDescription
callidUnique identifier of the call.
directionDirection of the call [inbound, outbound].
web_callIf the call originated on the call widget [yes, no].
agentThe email address of the agent registered in Toky.
agent_nameThe name of the agent as registered in your account
durationDuration of the call in seconds.
stateState of the call [completed, unsuccessful, missed].
- completed -> inbound/outbound successfully connected.
- unsuccessful -> outbound call not connected.
- missed-> inbound call not answered.
from_numberIts content varies depending on the direction of the call.

- Inbound: the phone number of the incoming call.
- Outbound: the Toky number you used to make the call.
to_numberIts content varies depending on the direction of the call.

- Inbound: contains the Toky number where the call was received.
- Outbound: contains the number the agent dialed.
dateThe date and time the call was made.
record_urlContains the url of the recording of the call in Toky's web app.

This field will be empty if the recording of calls is disabled in Toky.
record_url_rawContains the url to the recording of the call file. You can use this url if you want to access the file directly. This field will be empty if the recording of calls is disabled in Toky.
caller_nameIf present, the name of the caller when using the Toky call widget.
caller_emailIf present, the email of the caller when using the Toky call widget.
caller_countryThe country of the caller when using the Toky call widget.
caller_phone_numberIf present. the phone number of the caller when using the Toky call widget.
contact_nameThe name of the matching contact as registered in the Phone Directory or connected integration (Salesforce, Pipedrive, etc.)
contact_emailThe email address of the matching contact as registered in the Phone Directory or connected integration (Salesforce, Pipedrive, etc.)
contact_urlThe contact URL of the matching contact as registered in the Phone Directory or connected integration (Salesforce, Pipedrive, etc.)
ivr_option_pressedContains the IVR option pressed by the caller
reply_codePossible values:
200 -> OK
400-499 -> Client error
500-699 -> Server Error
error_messageError message values:

'486' => 'Busy',
'487' => 'Cancelled',
'402' => 'Payment Required',
'404' => 'Not Found',
'408' => 'Request Timeout',
'480' => 'Temporarily Unavailable',
'500 - 699' => 'Connection Error',
'default' => '' (empty)
answered_timeTime between incoming call and answered call in seconds.
in_queue_timeCallers queue waiting time in seconds.
tagsContains tags related to the call

"new_call" event json example

[{
"callid":"kcjsdnnfwiufwfnfr94njvdkf",
"direction":"inbound",
"web_call":"no",
"agent":"[email protected]",
"agent_name":"John Doe",
"duration":100,
"state":"completed",
"from_number":"+13013372465",
"to_number":"+12018442465",
"date":"2017-08-21T16:02:21-05:00",
"record_url":"",
"caller_name":"",
"caller_email":"",
"caller_country":"",
"caller_phone_number":"",
"contact_name" : "Pete Smith",
"contact_email" : "[email protected]",
"contact_url": "https://mycrm.com/profile/pete",
"ivr_option_pressed": 1,
"reply_code" : '200',
"error_message" : "",
"answered_time": 0,
"in_queue_time": 10,
"tags": ["testing", "example"]
}]

Event new_voicemail sent data description

NameDescription
callidunique identifier of the voicemail call.
statusThe status of the voicemail (abandoned | completed).
web_callIf the voicemail was generated from a web call (yes | no).
dateThe date the voicemail was created.
fromThe caller id of the voicemail. Could be a number or an email address.
to_numberThe toky number that received the voicemail.
durationDuration in seconds of the voicemail.
record_urlThe record url of a completed voicemail.
ivr_option_pressedContains the IVR option pressed by the caller

"new_voicemail" event json format example

[{
"callid":"kdjfcndkfjvndfndfjkjlkmc",
"status":"completed",
"web_call":"yes",
"date":"2017-08-21T09:00:22-04:00",
"from":"[email protected]",
"to_number": "+123455667",
"duration":"46",
"record_url":"https:\/\/app.toky.co\/business\/voicemail\/xxx-yyyy-zzzz",
"ivr_option_pressed": 1
}]

Event new_sms sent data description

NameDescription
to_numberThe number you sent or received the SMS. Depends if inbound or outbound.
from_numberThe number you sent or received the SMS. Depends if inbound or outbound.
directionThe direction of the SMS (inbound | outbound).
dateThe date the SMS was received or sent.
bodyThe text of the SMS.

"new_sms" event json format example

[{
"to_number":"+59598123456",
"from_number":"+16282333444",
"direction":"outbound",
"date":"2017-07-25T10:58:42-04:00",
"body":"test text message"
}]
Language
Click Try It! to start a request and see the response here!