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:

Name

Description

callid

Unique identifier of the call.

direction

Direction of the call [inbound, outbound].

web_call

If the call originated on the call widget [yes, no].

agent

The email address of the agent registered in Toky.

agent_name

The name of the agent as registered in your account

duration

Duration of the call in seconds.

state

State of the call [completed, unsuccessful, missed].

  • completed -> inbound/outbound successfully connected.
  • unsuccessful -> outbound call not connected.
  • missed-> inbound call not answered.

from_number

Its 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_number

Its 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.

date

The date and time the call was made.

record_url

Contains 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_raw

Contains 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_name

If present, the name of the caller when using the Toky call widget.

caller_email

If present, the email of the caller when using the Toky call widget.

caller_country

The country of the caller when using the Toky call widget.

caller_phone_number

If present. the phone number of the caller when using the Toky call widget.

contact_name

The name of the matching contact as registered in the Phone Directory or connected integration (Salesforce, Pipedrive, etc.)

contact_email

The email address of the matching contact as registered in the Phone Directory or connected integration (Salesforce, Pipedrive, etc.)

contact_url

The contact URL of the matching contact as registered in the Phone Directory or connected integration (Salesforce, Pipedrive, etc.)

ivr_option_pressed

Contains the IVR option pressed by the caller

reply_code

Possible values:
200 -> OK
400-499 -> Client error
500-699 -> Server Error

error_message

Error 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_time

Time between incoming call and answered call in seconds.

in_queue_time

Callers queue waiting time in seconds.

tags

Contains 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

Name

Description

callid

unique identifier of the voicemail call.

status

The status of the voicemail (abandoned | completed).

web_call

If the voicemail was generated from a web call (yes | no).

date

The date the voicemail was created.

from

The caller id of the voicemail. Could be a number or an email address.

to_number

The toky number that received the voicemail.

duration

Duration in seconds of the voicemail.

record_url

The record url of a completed voicemail.

ivr_option_pressed

Contains 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

Name

Description

to_number

The number you sent or received the SMS. Depends if inbound or outbound.

from_number

The number you sent or received the SMS. Depends if inbound or outbound.

direction

The direction of the SMS (inbound | outbound).

date

The date the SMS was received or sent.

body

The 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!