Webhooks

Webhooks (formerly Server Callback) are a feature intended for software developers. When activated, it sends an HTTP POST request to a URL of your choice immediately after each call is completed. This URL can be configured on a per-company basis.  The request will contain data in the JSON format.

Use this article to learn how to:

  • Add webhooks to a company in your account
  • Test your webhooks
  • Disable webhooks you no longer need

Getting Started

Webhooks allow you to send real-time call notifications to your own web applications and reporting systems. There are three types of webhooks for calls: pre-call, post-call, and call modified webhooks.  

  • Pre-Call Webhook: The pre-call webhook executes the moment the phone call is received by CallRail. Your server will receive the call information before the call is connected, allowing you to develop real-time systems for your representatives, such as screen-pops or CRM database lookups.

    Because the pre-call webhook executes before the call is connected, it contains less information than the post-call webhook. For example, the post-call webhook will contain the call duration, whether the call was answered, and a link to the recording (if applicable).

  • Post-Call Webhook: The post-call webhook executes immediately after the phone call has completed. It contains the full data about the call, as described below.

  • Call Modified Webhook: The call modified webhook is sent when a call has changed after it has ended. For example, adding a tag or note, or when a delayed call recording has come available.

  • Query String Data Deprecated: All attributes are available in the JSON POST body, and this is what we recommend using. A limited number of attributes are available in the query string. New attributes are only being added to the JSON POST body.

Alternatively, if you're using a third-party tool to track visitors via cookies, you can use Webhooks to associate visitor data with phone calls to your CallRail numbers. This data would appear on your caller's timelines after configuring our Custom Cookie Capture integration. 

Use this article to learn more about Custom Cookie Capture.

Example Request

  POST "/?datetime=2012-08-22+20%3A44%3A43&trackingnum=%2B14047773734&callernum=%2B17451187568&destinationnum=4041234567&callsource=disabled&callername=Olivia+Rodriguez&keywords=&referrer=&referrermedium=&landingpage=&recording=https%3A%2F%app.callrail.com%2Fcalls%2F197479887%2Frecording%2Fc9ad534a44ee2b426c4e&answered=true&duration=291&first_call=true"

JSON Body:
{
  "datetime": "2013-02-05 16:14:43",
  "trackingnum": "+14047773734",
  "callernum": "+17451187568",
  "destinationnum": "4041234567",
  "callsource": "disabled",
  "callername": "Olivia Rodriguez",
  "keywords": "",
  "referrer": "",
  "referrermedium": "",
  "landingpage": "",
  "recording": "https://app.callrail.com/calls/247716205/recording/1b6d7d5f0c54f2e2ed4b",
  "answered": true,
  "duration": "157",
  "first_call": true
}

Available Parameters

For a full list of requests you can implementation, read our developer docs:

Developer Documentation

Security Keys for Webhooks

CallRail generates a secret, random token for every company. You can find each company's key viewed on the webhooks configuration page outlined in the next section. The token is used with the request payload to generate a hash signature that is passed as a request header in the webhook request. You can use the secret token on your server to recompute the same hash based on the request payload. If your computed signature matches the header that CallRail sends, the request is valid.

Adding a Webhook to CallRail

  1. Click Settings at the top of the page.

    settings.png

  2. Choose the company you’d like to create a webhook.

    company_copy.png

  3. Select All Integrations from the Integrations menu on the left.

    screenshot_479.png

  4. Choose Webhooks from the list of available integrations.

    screenshot_623.png

  5. Paste the RequestBin URL from step 2 into the field of the Webhook you'd like to test.



  6. Select Activate when finished.

    screenshot_642.png

 

Disabling Webhooks

Disabling a company's webhooks will prevent CallRail from sending your call data to your third-party integrations. We'll keep your webhooks saved in case you'd like to re-activate your integration in the future.

  1. Click Settings at the top of the page.

    settings.png

  2. Choose the company whose webhooks you'd like to disable.

    company_copy.png

  3. Select All Integrations from the Integrations menu on the left.

    screenshot_479.png

  4. Choose Webhooks from the list of integrations.

    screenshot_623.png

  5. Select Disable Integration on the right side of the page.

    screenshot_613.png

  6. Click Disable to turn off your webhooks integration.



Have more questions? Submit a request

Comments

Need additional help? Ask our Community!