Recevez votre lien de démonstration gratuitement en cliquant ici

Recevez votre lien de démonstration gratuitement en cliquant ici

API & Connecteurs

Create, configure and test a webhook

Receive your call, lead and tracked email data in your own tools in real time: creating the webhook, choosing events, filters, testing and verifying the signature.

Par · Lead DeveloperMis à jour le 10 novembre 2026
À quoi ça sertPush every call, lead or tracked email to your CRM or tools as soon as it happens.
PrérequisAn HTTPS endpoint able to receive JSON POST requests, and access to API & connectors.
Mise en service15 minutes of configuration, plus the development of your endpoint.

A webhook automatically sends the data of an event (call completed, missed call, lead created, email received…) to the URL of your choice, as soon as it happens. Where the API lets you query Magnétis whenever you want, the webhook comes to you: no request to schedule, the data lands in your CRM or business tool on its own.

SchémaHow a webhook travels
Incoming callon a trackednumbermMagnétisChosen eventWebhookYour endpointYYour CRMSave the callYYour toolsProcess thedata123Incoming callon a trackednumbermMagnétisChosen eventWebhookYour endpointYYour CRMSave the callYYour toolsProcess the data
On each chosen event (call completed, missed call, email received…), Magnétis sends the data to your endpoint URL, which feeds it into your tools.
SchémaHow a webhook travels
Incoming callon a trackednumbermMagnétisChosen eventWebhookYour endpointYYour CRMSave the callYYour toolsProcess thedata123Incoming callon a trackednumbermMagnétisChosen eventWebhookYour endpointYYour CRMSave the callYYour toolsProcess the data
On each chosen event (call completed, missed call, email received…), Magnétis sends the data to your endpoint URL, which feeds it into your tools.
SchémaHow a webhook travels
Incoming callon a trackednumbermMagnétisChosen eventWebhookYour endpointYYour CRMSave the callYYour toolsProcess thedata123Incoming callon a trackednumbermMagnétisChosen eventWebhookYour endpointYYour CRMSave the callYYour toolsProcess the data
On each chosen event (call completed, missed call, email received…), Magnétis sends the data to your endpoint URL, which feeds it into your tools.

No developer at hand? The same automations can be built without code with Zapier, Make or n8n.

Create a webhook

Webhooks can be created at the organization level (for all your accounts), on a network or on an account. Switch to the level you need, open API & connectors › Webhooks and click Create a webhook.

Webhooks page

The form has three steps:

  1. Destination: a name to recognize the webhook (e.g. "Branch CRM") and the endpoint URL that will receive the data, as JSON POST requests.

  2. Events: tick the events that trigger a send (list below).

  3. Activation: the Active webhook switch. An inactive webhook keeps its configuration but no longer sends anything.

Creating a webhook

Confirm with Create the webhook. The list then shows each webhook's events, last delivery date and status. From an organization or a network, a section also lists the webhooks created directly in the linked accounts and networks.

Available events

Family

Event

Sent…

Calls

call:initiated

when a call is initiated

Calls

call:forwarded

when a call is forwarded to a recipient

Calls

call:ringing

when a call is ringing

Calls

call:answered

when a call is answered, or picked up by a voicemail

Calls

call:completed

when a call ends

Calls

call:missed

when a call is missed

Calls

call:conversion

when a call is linked to a visitor journey

Calls

call:recording

when a recording or voicemail is ready

AI analysis

call:transcript

when a call transcript is available

AI analysis

call:analysis

when a call analysis is available

Leads

lead:created

when a lead is created

Leads

lead:updated

when a lead is updated

Web Callback

callback:requested

when a callback request is submitted

Email tracking

email:received

when an email is received

AI analysis events are only sent for numbers where AI call analysis (in French) is active. call:conversion requires the web module (in French), and callback:requested requires Web Callback (in French).

Limit an event

For call events, the Limit this event option restricts sends to the numbers of a group (the button next to the list creates a group without leaving the form). For call:completed, you can also set conditions on the call duration, for example "greater than or equal to 30 seconds" to send only real conversations. Conditions within a block are combined with AND, blocks with OR. A filtered event shows the Filtered label in the form.

Limiting a webhook event

Data format

Each send is a POST request whose JSON body contains the event and the related resource. Simplified example for call:completed:

{
  "event": "call:completed",
  "data": {
    "id": "cal-abc123",
    "calling_number": "+33612345678",
    "duration": 120,
    "missed": false
  }
}
{
  "event": "call:completed",
  "data": {
    "id": "cal-abc123",
    "calling_number": "+33612345678",
    "duration": 120,
    "missed": false
  }
}
{
  "event": "call:completed",
  "data": {
    "id": "cal-abc123",
    "calling_number": "+33612345678",
    "duration": 120,
    "missed": false
  }
}

The full model of each resource (call, lead, email, callback request) is described in the API documentation.

Test the webhook

Open the webhook and click Send a test. Choose the resource to send (Call, Lead, Email or Callback request): Magnétis sends sample data to your endpoint and shows the request sent and the response received.

The Delivery history tab keeps the last 10 events sent, with the request and your endpoint's response: it is the first place to look when data does not arrive.

Webhook delivery history

Verify the request signature

Each request carries a header proving that it comes from Magnétis:

X-CALLTRACKING-SIGNATURE: <base64 value>
X-CALLTRACKING-SIGNATURE: <base64 value>
X-CALLTRACKING-SIGNATURE: <base64 value>

This signature is an HMAC-SHA1, base64-encoded, computed from your endpoint URL, the request body and your signature key. The key is shown in the webhook details (Show and Copy buttons). Regenerate key creates a new one: remember to update the verification on your endpoint.

Algorithm

1. Start with an initial string = your endpoint URL
2. Sort the JSON payload keys alphabetically (recursively)
3. For each key (in sorted order):
   - If the value is an object/array → recurse
   - If the value is null, false, 0 or "" → skip it
   - Otherwise → append: key + value
      (true booleans become "1")
4. Compute HMAC-SHA1(string, secret_key) with raw binary output
5. Base64-encode the result
1. Start with an initial string = your endpoint URL
2. Sort the JSON payload keys alphabetically (recursively)
3. For each key (in sorted order):
   - If the value is an object/array → recurse
   - If the value is null, false, 0 or "" → skip it
   - Otherwise → append: key + value
      (true booleans become "1")
4. Compute HMAC-SHA1(string, secret_key) with raw binary output
5. Base64-encode the result
1. Start with an initial string = your endpoint URL
2. Sort the JSON payload keys alphabetically (recursively)
3. For each key (in sorted order):
   - If the value is an object/array → recurse
   - If the value is null, false, 0 or "" → skip it
   - Otherwise → append: key + value
      (true booleans become "1")
4. Compute HMAC-SHA1(string, secret_key) with raw binary output
5. Base64-encode the result

Watch out for booleans: true is sent as 1 in the signed string, and false is skipped, like null. Reproduce this behavior in your implementation.

Verification example

For the payload above sent to https://your-server.com/receive-webhook with the key your-signature-key, the expected signature is Q2u7t28KQ8MvtvbD+I3vwHRRLAY=. missed: false is skipped, duration: 120 is included as "120".

Implementations by language

PHP

<?php

function verifyWebhookSignature(
    string $endpoint,
    string $secretKey,
    array  $payload,
    string $receivedSignature
): bool {
    $computed = computeWebhookSignature($endpoint, $secretKey, $payload);
    return hash_equals($computed, $receivedSignature);
}

function computeWebhookSignature(string $endpoint, string $secretKey, array $payload): string
{
    $str = $endpoint;
    $str = dataLoop($str, $payload);
    return base64_encode(hash_hmac('sha1', $str, $secretKey, true));
}

function dataLoop(string $signature, array $data): string
{
    ksort($data);
    foreach ($data as $key => $value) {
        if (is_array($value)) {
            $signature = dataLoop($signature, $value);
        } elseif ($value != null) {   // loose comparison: skips null, false, 0, ''
            $signature .= $key . $value;
        }
    }
    return $signature;
}

// --- Usage in a controller ---

$endpoint = 'https://your-server.com/receive-webhook'; // your endpoint URL
$secretKey = 'your-signature-key';                      // your secret key
$payload = json_decode(file_get_contents('php://input'), true);
$receivedSignature = $_SERVER['HTTP_X_CALLTRACKING_SIGNATURE'] ?? '';

if (!verifyWebhookSignature($endpoint, $secretKey, $payload, $receivedSignature)) {
    http_response_code(400);
    echo json_encode(['error' => 'Invalid signature']);
    exit;
}

// Process the webhook…
http_response_code(200);
echo json_encode(['status' => 'ok']);
<?php

function verifyWebhookSignature(
    string $endpoint,
    string $secretKey,
    array  $payload,
    string $receivedSignature
): bool {
    $computed = computeWebhookSignature($endpoint, $secretKey, $payload);
    return hash_equals($computed, $receivedSignature);
}

function computeWebhookSignature(string $endpoint, string $secretKey, array $payload): string
{
    $str = $endpoint;
    $str = dataLoop($str, $payload);
    return base64_encode(hash_hmac('sha1', $str, $secretKey, true));
}

function dataLoop(string $signature, array $data): string
{
    ksort($data);
    foreach ($data as $key => $value) {
        if (is_array($value)) {
            $signature = dataLoop($signature, $value);
        } elseif ($value != null) {   // loose comparison: skips null, false, 0, ''
            $signature .= $key . $value;
        }
    }
    return $signature;
}

// --- Usage in a controller ---

$endpoint = 'https://your-server.com/receive-webhook'; // your endpoint URL
$secretKey = 'your-signature-key';                      // your secret key
$payload = json_decode(file_get_contents('php://input'), true);
$receivedSignature = $_SERVER['HTTP_X_CALLTRACKING_SIGNATURE'] ?? '';

if (!verifyWebhookSignature($endpoint, $secretKey, $payload, $receivedSignature)) {
    http_response_code(400);
    echo json_encode(['error' => 'Invalid signature']);
    exit;
}

// Process the webhook…
http_response_code(200);
echo json_encode(['status' => 'ok']);
<?php

function verifyWebhookSignature(
    string $endpoint,
    string $secretKey,
    array  $payload,
    string $receivedSignature
): bool {
    $computed = computeWebhookSignature($endpoint, $secretKey, $payload);
    return hash_equals($computed, $receivedSignature);
}

function computeWebhookSignature(string $endpoint, string $secretKey, array $payload): string
{
    $str = $endpoint;
    $str = dataLoop($str, $payload);
    return base64_encode(hash_hmac('sha1', $str, $secretKey, true));
}

function dataLoop(string $signature, array $data): string
{
    ksort($data);
    foreach ($data as $key => $value) {
        if (is_array($value)) {
            $signature = dataLoop($signature, $value);
        } elseif ($value != null) {   // loose comparison: skips null, false, 0, ''
            $signature .= $key . $value;
        }
    }
    return $signature;
}

// --- Usage in a controller ---

$endpoint = 'https://your-server.com/receive-webhook'; // your endpoint URL
$secretKey = 'your-signature-key';                      // your secret key
$payload = json_decode(file_get_contents('php://input'), true);
$receivedSignature = $_SERVER['HTTP_X_CALLTRACKING_SIGNATURE'] ?? '';

if (!verifyWebhookSignature($endpoint, $secretKey, $payload, $receivedSignature)) {
    http_response_code(400);
    echo json_encode(['error' => 'Invalid signature']);
    exit;
}

// Process the webhook…
http_response_code(200);
echo json_encode(['status' => 'ok']);

Node.js

const crypto = require('crypto');

function computeWebhookSignature(endpoint, secretKey, payload) {
    let str = endpoint;
    str = dataLoop(str, payload);
    return crypto.createHmac('sha1', secretKey).update(str).digest('base64');
}

function dataLoop(signature, data) {
    const keys = Object.keys(data).sort();
    for (const key of keys) {
        const value = data[key];
        if (value !== null && typeof value === 'object') {
            signature = dataLoop(signature, value);
        } else if (value === null || value === false || value === 0 || value === '') {
            // skip falsy values (null, false, 0, "")
        } else {
            const strValue = value === true ? '1' : String(value);
            signature += key + strValue;
        }
    }
    return signature;
}

function verifyWebhookSignature(endpoint, secretKey, payload, receivedSignature) {
    const computed = computeWebhookSignature(endpoint, secretKey, payload);
    return crypto.timingSafeEqual(
        Buffer.from(computed),
        Buffer.from(receivedSignature)
    );
}

// --- Usage with Express ---

const express = require('express');
const app = express();
app.use(express.json());

app.post('/receive-webhook', (req, res) => {
    const endpoint          = 'https://your-server.com/receive-webhook';
    const secretKey         = 'your-signature-key';
    const receivedSignature = req.headers['x-calltracking-signature'] || '';

    try {
        if (!verifyWebhookSignature(endpoint, secretKey, req.body, receivedSignature)) {
            return res.status(400).json({ error: 'Invalid signature' });
        }
    } catch {
        return res.status(400).json({ error: 'Invalid signature' });
    }

    // Process the webhook…
    console.log('Event received:', req.body.event);
    res.status(200).json({ status: 'ok' });
});

app.listen(8080, () => {
    console.log('Webhook receiver running on http://localhost:8080');
});
const crypto = require('crypto');

function computeWebhookSignature(endpoint, secretKey, payload) {
    let str = endpoint;
    str = dataLoop(str, payload);
    return crypto.createHmac('sha1', secretKey).update(str).digest('base64');
}

function dataLoop(signature, data) {
    const keys = Object.keys(data).sort();
    for (const key of keys) {
        const value = data[key];
        if (value !== null && typeof value === 'object') {
            signature = dataLoop(signature, value);
        } else if (value === null || value === false || value === 0 || value === '') {
            // skip falsy values (null, false, 0, "")
        } else {
            const strValue = value === true ? '1' : String(value);
            signature += key + strValue;
        }
    }
    return signature;
}

function verifyWebhookSignature(endpoint, secretKey, payload, receivedSignature) {
    const computed = computeWebhookSignature(endpoint, secretKey, payload);
    return crypto.timingSafeEqual(
        Buffer.from(computed),
        Buffer.from(receivedSignature)
    );
}

// --- Usage with Express ---

const express = require('express');
const app = express();
app.use(express.json());

app.post('/receive-webhook', (req, res) => {
    const endpoint          = 'https://your-server.com/receive-webhook';
    const secretKey         = 'your-signature-key';
    const receivedSignature = req.headers['x-calltracking-signature'] || '';

    try {
        if (!verifyWebhookSignature(endpoint, secretKey, req.body, receivedSignature)) {
            return res.status(400).json({ error: 'Invalid signature' });
        }
    } catch {
        return res.status(400).json({ error: 'Invalid signature' });
    }

    // Process the webhook…
    console.log('Event received:', req.body.event);
    res.status(200).json({ status: 'ok' });
});

app.listen(8080, () => {
    console.log('Webhook receiver running on http://localhost:8080');
});
const crypto = require('crypto');

function computeWebhookSignature(endpoint, secretKey, payload) {
    let str = endpoint;
    str = dataLoop(str, payload);
    return crypto.createHmac('sha1', secretKey).update(str).digest('base64');
}

function dataLoop(signature, data) {
    const keys = Object.keys(data).sort();
    for (const key of keys) {
        const value = data[key];
        if (value !== null && typeof value === 'object') {
            signature = dataLoop(signature, value);
        } else if (value === null || value === false || value === 0 || value === '') {
            // skip falsy values (null, false, 0, "")
        } else {
            const strValue = value === true ? '1' : String(value);
            signature += key + strValue;
        }
    }
    return signature;
}

function verifyWebhookSignature(endpoint, secretKey, payload, receivedSignature) {
    const computed = computeWebhookSignature(endpoint, secretKey, payload);
    return crypto.timingSafeEqual(
        Buffer.from(computed),
        Buffer.from(receivedSignature)
    );
}

// --- Usage with Express ---

const express = require('express');
const app = express();
app.use(express.json());

app.post('/receive-webhook', (req, res) => {
    const endpoint          = 'https://your-server.com/receive-webhook';
    const secretKey         = 'your-signature-key';
    const receivedSignature = req.headers['x-calltracking-signature'] || '';

    try {
        if (!verifyWebhookSignature(endpoint, secretKey, req.body, receivedSignature)) {
            return res.status(400).json({ error: 'Invalid signature' });
        }
    } catch {
        return res.status(400).json({ error: 'Invalid signature' });
    }

    // Process the webhook…
    console.log('Event received:', req.body.event);
    res.status(200).json({ status: 'ok' });
});

app.listen(8080, () => {
    console.log('Webhook receiver running on http://localhost:8080');
});

Python

import hmac
import hashlib
import base64
from flask import Flask, request, jsonify

def compute_webhook_signature(endpoint: str, secret_key: str, payload: dict) -> str:
    signature_str = endpoint
    signature_str = data_loop(signature_str, payload)
    mac = hmac.new(secret_key.encode('utf-8'), signature_str.encode('utf-8'), hashlib.sha1)
    return base64.b64encode(mac.digest()).decode('utf-8')

def data_loop(signature: str, data) -> str:
    if isinstance(data, list):
        items = [(str(i), v) for i, v in enumerate(data)] 
    else:
        items = sorted(data.items(), key=lambda x: str(x[0])) 

    for key, value in items:
        if isinstance(value, (dict, list)):
            signature = data_loop(signature, value)
        elif value in (None, False, 0, ''):
            pass
        else:
            str_value = '1' if value is True else str(value)
            signature += key + str_value
    return signature

def verify_webhook_signature(endpoint: str, secret_key: str, payload: dict, received_signature: str) -> bool:
    computed = compute_webhook_signature(endpoint, secret_key, payload)
    return hmac.compare_digest(computed, received_signature)

# --- Usage with Flask ---

app = Flask(__name__)

@app.route('/receive-webhook', methods=['POST'])
def receive_webhook():
    endpoint           = 'https://your-server.com/receive-webhook'
    secret_key         = 'your-signature-key'
    received_signature = request.headers.get('X-Calltracking-Signature', '')
    payload            = request.get_json()

    if not verify_webhook_signature(endpoint, secret_key, payload, received_signature):
        return jsonify({'error': 'Invalid signature'}), 400

    # Process the webhook…
    print('Event received:', payload.get('event'))
    return jsonify({'status': 'ok'}), 200
import hmac
import hashlib
import base64
from flask import Flask, request, jsonify

def compute_webhook_signature(endpoint: str, secret_key: str, payload: dict) -> str:
    signature_str = endpoint
    signature_str = data_loop(signature_str, payload)
    mac = hmac.new(secret_key.encode('utf-8'), signature_str.encode('utf-8'), hashlib.sha1)
    return base64.b64encode(mac.digest()).decode('utf-8')

def data_loop(signature: str, data) -> str:
    if isinstance(data, list):
        items = [(str(i), v) for i, v in enumerate(data)] 
    else:
        items = sorted(data.items(), key=lambda x: str(x[0])) 

    for key, value in items:
        if isinstance(value, (dict, list)):
            signature = data_loop(signature, value)
        elif value in (None, False, 0, ''):
            pass
        else:
            str_value = '1' if value is True else str(value)
            signature += key + str_value
    return signature

def verify_webhook_signature(endpoint: str, secret_key: str, payload: dict, received_signature: str) -> bool:
    computed = compute_webhook_signature(endpoint, secret_key, payload)
    return hmac.compare_digest(computed, received_signature)

# --- Usage with Flask ---

app = Flask(__name__)

@app.route('/receive-webhook', methods=['POST'])
def receive_webhook():
    endpoint           = 'https://your-server.com/receive-webhook'
    secret_key         = 'your-signature-key'
    received_signature = request.headers.get('X-Calltracking-Signature', '')
    payload            = request.get_json()

    if not verify_webhook_signature(endpoint, secret_key, payload, received_signature):
        return jsonify({'error': 'Invalid signature'}), 400

    # Process the webhook…
    print('Event received:', payload.get('event'))
    return jsonify({'status': 'ok'}), 200
import hmac
import hashlib
import base64
from flask import Flask, request, jsonify

def compute_webhook_signature(endpoint: str, secret_key: str, payload: dict) -> str:
    signature_str = endpoint
    signature_str = data_loop(signature_str, payload)
    mac = hmac.new(secret_key.encode('utf-8'), signature_str.encode('utf-8'), hashlib.sha1)
    return base64.b64encode(mac.digest()).decode('utf-8')

def data_loop(signature: str, data) -> str:
    if isinstance(data, list):
        items = [(str(i), v) for i, v in enumerate(data)] 
    else:
        items = sorted(data.items(), key=lambda x: str(x[0])) 

    for key, value in items:
        if isinstance(value, (dict, list)):
            signature = data_loop(signature, value)
        elif value in (None, False, 0, ''):
            pass
        else:
            str_value = '1' if value is True else str(value)
            signature += key + str_value
    return signature

def verify_webhook_signature(endpoint: str, secret_key: str, payload: dict, received_signature: str) -> bool:
    computed = compute_webhook_signature(endpoint, secret_key, payload)
    return hmac.compare_digest(computed, received_signature)

# --- Usage with Flask ---

app = Flask(__name__)

@app.route('/receive-webhook', methods=['POST'])
def receive_webhook():
    endpoint           = 'https://your-server.com/receive-webhook'
    secret_key         = 'your-signature-key'
    received_signature = request.headers.get('X-Calltracking-Signature', '')
    payload            = request.get_json()

    if not verify_webhook_signature(endpoint, secret_key, payload, received_signature):
        return jsonify({'error': 'Invalid signature'}), 400

    # Process the webhook…
    print('Event received:', payload.get('event'))
    return jsonify({'status': 'ok'}), 200

Values included in the signature

Value

Included?

Note

"text"

Yes

As is

123 (integer)

Yes

Sent as "123"

true

Yes

Sent as "1"

null

No

Skipped

false

No

Skipped (like null)

0

No

Skipped (like null)

"" (empty)

No

Skipped (like null)

Nested object

Yes

Recursive, sorted keys

Going further

Questions fréquentes

What is the difference between a webhook and the API?

The webhook pushes data to your endpoint as soon as an event occurs. The API lets you query Magnétis on demand, for example to fetch history or create a callback request.

How do I know if my endpoint receives the data?

Open the webhook: the delivery history shows the last 10 events with the request sent and your endpoint's response. The Send a test button lets you check without waiting for a real call.

Can I send only calls above a certain duration?

Yes. On the call-completed event (call:completed), enable Limit this event and add a duration condition, for example greater than or equal to 30 seconds.

Can a webhook cover only some numbers?

Yes, for call events: limit the event to the numbers of a group. You can also create the webhook directly in the relevant account.

What if my signature key has leaked?

Click Regenerate key in the webhook details, then update the key your endpoint uses to verify the signature.

Support

Toujours bloqué ?

Notre équipe vous répond du lundi au vendredi, de 9 h à 18 h. Les tickets sont reçus 24 h/24, 7 j/7.

Ouvrir un ticket

Configuration, numéros, connecteurs, facturation : décrivez votre besoin, nous revenons vers vous rapidement.

Créer un ticket

Appeler le support

Pour une question urgente ou un blocage en cours de mise en place.

01 85 08 31 99

Questions fréquentes

Fonctionnement, installation, tarifs et données : les réponses courtes aux questions les plus posées.

Voir la FAQ