How to set up webhook triggers in Aircall for seamless data integration?

aircall integration logo in a blog cover photo

Setting up webhook triggers in Aircall allows you to seamlessly pass data to external systems based on key events, such as when a user is created, a number is closed, a message is sent, or a call is ringing on agents. 

Webhooks can also trigger updates when a contact is modified or new “Conversation Intelligence” events, like sentiment analysis, are generated. 

This guide walks you through setting up Aircall webhooks using the Aircall dashboard and API for efficient data transfer and event management.

Setting up webhooks in Aircall via the dashboard

To configure webhooks directly in the Aircall dashboard: 

1. On the Integration page, click "Webhook integration."

2. Then click "Install".

3. In the integration name (custom) field, you can set a name to identify your webhooks in the integrations list easily. (Optional) 

4. Next, in the URL field, set the URL of the endpoint you created on your web server. Only one URL is available, and header changes are not allowed.

5. Toggle the switches of the events you want to receive. The events are all turned on by default.

6. Finally "Save" to finish the configuration.

integration setup screen with binded events

Creating Webhooks Using the Aircall Public API

The Aircall Public API enables you to fetch, create, update, and delete webhooks for your Aircall account. For authentication, if you're a tech partner of Aircall, you can use OAuth, which restricts access to only the webhooks linked to your token. 

If you’re an Aircall customer, you can use Basic Auth, allowing access to webhooks created through the Aircall dashboard and Basic Auth API requests.

Let's look at the more general way: using Basic Auth to call the Aircall API.

1) Get your api_id and api_token for authorization.

  • Go to your company's settings page.

  • Click "Add a new API key" in the API Keys section to get your api_id and api_token.

  • In the Basic Auth format, the api_id will be your username. The api_token will be your api_token.

2) Call Aircall API to create a new webhook

  • Go to Postman and create a new HTTP request. 

  • Choose POST action.

  • Set the URL field as “https://api.aircall.io/v1/webhooks.”

  • Input the header with “Content-Type”: application/json.

  • Input the authorization with api_id as the username and api_token as the password.

  • Input the POST request body using the following

{ "custom_name": "My Custom Workflow", "url": "https://my-server.example.com/webhooks/contacts", "events": [ "contact.created", "contact.updated", "contact.deleted" ]

}

  • custom_name: the name you want to refer to on your webhook.

  • url: the URL of the destination.

  • events: the events upon which you want to trigger

3. Send the API request, and once you receive the 201 response status, the configuration is done.

Status: 201 Created { "webhook": { "webhook_id": "c2501111-8a69-4342-bb34-bcd6cfe564ab", "direct_link": "https://api.aircall.io/v1/webhooks/26316", "created_at": "2020-03-24T19:51:24.000Z", "url": "https://my-server.example.com/webhooks/contacts", "active": true, "events": [ "contact.created", "contact.updated", "contact.deleted" ], "token": "df76g76dpziygs567f0" } }

Best practices for managing webhooks in Aircall

Properly handling webhooks in Aircall can help streamline communication between systems and improve overall workflow efficiency. Implementing these best practices will lead to smoother, more reliable integrations.

  1. Use HTTPS webhook URL.

  2. Always return a 200 HTTP code.

  3. Handle big tasks in an asynchronous way.

  4. Test your app on localhost.

  5. Automatically re-enable deactivated webhooks.

Key differences between call.hungup and call.ended events

The all.hungup event is triggered immediately at the end of a call, even if the call data is not yet ready. This event can be used to build real-time dashboards and other applications that need to react quickly to call termination.

The call.ended event is triggered when all the data related to a call has been gathered, such as call recording files, duration, and other details. This event is often triggered approximately 30 seconds after the actual end of the call. This event can store the complete call data on your server for further processing or archiving.

Integrate your existing tech stack with SleekFlow

Automate workflows with personalized experiences to delight customers and optimize resources effectively.

Frequently Asked Questions

Share Article

Recommended for you

Automate your growth with

Get started for free and supercharge your customer engagement.