Handle ElevenLabs pre-call personalization webhook
curl --request POST \
--url https://your-instance.example.com/api/webhook/elevenlabs/personalization \
--header 'Content-Type: application/json' \
--data '
{
"conversation_id": "conv_8f3d1b9c2e7a4f0b9a4d2c1e6e2f8c01",
"caller_id": "+14165550100",
"called_id": "+12362320246",
"agent_id": "agent_a8d3c4e09b2f4e1ab3c45f6a7b8c9d01"
}
'import requests
url = "https://your-instance.example.com/api/webhook/elevenlabs/personalization"
payload = {
"conversation_id": "conv_8f3d1b9c2e7a4f0b9a4d2c1e6e2f8c01",
"caller_id": "+14165550100",
"called_id": "+12362320246",
"agent_id": "agent_a8d3c4e09b2f4e1ab3c45f6a7b8c9d01"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
conversation_id: 'conv_8f3d1b9c2e7a4f0b9a4d2c1e6e2f8c01',
caller_id: '+14165550100',
called_id: '+12362320246',
agent_id: 'agent_a8d3c4e09b2f4e1ab3c45f6a7b8c9d01'
})
};
fetch('https://your-instance.example.com/api/webhook/elevenlabs/personalization', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your-instance.example.com/api/webhook/elevenlabs/personalization",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'conversation_id' => 'conv_8f3d1b9c2e7a4f0b9a4d2c1e6e2f8c01',
'caller_id' => '+14165550100',
'called_id' => '+12362320246',
'agent_id' => 'agent_a8d3c4e09b2f4e1ab3c45f6a7b8c9d01'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your-instance.example.com/api/webhook/elevenlabs/personalization"
payload := strings.NewReader("{\n \"conversation_id\": \"conv_8f3d1b9c2e7a4f0b9a4d2c1e6e2f8c01\",\n \"caller_id\": \"+14165550100\",\n \"called_id\": \"+12362320246\",\n \"agent_id\": \"agent_a8d3c4e09b2f4e1ab3c45f6a7b8c9d01\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://your-instance.example.com/api/webhook/elevenlabs/personalization")
.header("Content-Type", "application/json")
.body("{\n \"conversation_id\": \"conv_8f3d1b9c2e7a4f0b9a4d2c1e6e2f8c01\",\n \"caller_id\": \"+14165550100\",\n \"called_id\": \"+12362320246\",\n \"agent_id\": \"agent_a8d3c4e09b2f4e1ab3c45f6a7b8c9d01\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/webhook/elevenlabs/personalization")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"conversation_id\": \"conv_8f3d1b9c2e7a4f0b9a4d2c1e6e2f8c01\",\n \"caller_id\": \"+14165550100\",\n \"called_id\": \"+12362320246\",\n \"agent_id\": \"agent_a8d3c4e09b2f4e1ab3c45f6a7b8c9d01\"\n}"
response = http.request(request)
puts response.read_body{
"caller_name": "Alex Morgan",
"caller_number": "+14165550100",
"org_name": "Acme Corp"
}{
"error": "Webhook processing failed"
}Webhooks
Handle ElevenLabs pre-call personalization webhook
Inbound webhook called by ElevenLabs when a call connects so the AI agent can greet the caller by name. Looks up the contact by caller_id, caches the call context in Redis (24h TTL) for the post-call webhook, and returns dynamic variables for prompt injection. Authenticated via Bearer token (per-org elevenlabsToolSecret).
POST
/
api
/
webhook
/
elevenlabs
/
personalization
Handle ElevenLabs pre-call personalization webhook
curl --request POST \
--url https://your-instance.example.com/api/webhook/elevenlabs/personalization \
--header 'Content-Type: application/json' \
--data '
{
"conversation_id": "conv_8f3d1b9c2e7a4f0b9a4d2c1e6e2f8c01",
"caller_id": "+14165550100",
"called_id": "+12362320246",
"agent_id": "agent_a8d3c4e09b2f4e1ab3c45f6a7b8c9d01"
}
'import requests
url = "https://your-instance.example.com/api/webhook/elevenlabs/personalization"
payload = {
"conversation_id": "conv_8f3d1b9c2e7a4f0b9a4d2c1e6e2f8c01",
"caller_id": "+14165550100",
"called_id": "+12362320246",
"agent_id": "agent_a8d3c4e09b2f4e1ab3c45f6a7b8c9d01"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
conversation_id: 'conv_8f3d1b9c2e7a4f0b9a4d2c1e6e2f8c01',
caller_id: '+14165550100',
called_id: '+12362320246',
agent_id: 'agent_a8d3c4e09b2f4e1ab3c45f6a7b8c9d01'
})
};
fetch('https://your-instance.example.com/api/webhook/elevenlabs/personalization', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your-instance.example.com/api/webhook/elevenlabs/personalization",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'conversation_id' => 'conv_8f3d1b9c2e7a4f0b9a4d2c1e6e2f8c01',
'caller_id' => '+14165550100',
'called_id' => '+12362320246',
'agent_id' => 'agent_a8d3c4e09b2f4e1ab3c45f6a7b8c9d01'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your-instance.example.com/api/webhook/elevenlabs/personalization"
payload := strings.NewReader("{\n \"conversation_id\": \"conv_8f3d1b9c2e7a4f0b9a4d2c1e6e2f8c01\",\n \"caller_id\": \"+14165550100\",\n \"called_id\": \"+12362320246\",\n \"agent_id\": \"agent_a8d3c4e09b2f4e1ab3c45f6a7b8c9d01\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://your-instance.example.com/api/webhook/elevenlabs/personalization")
.header("Content-Type", "application/json")
.body("{\n \"conversation_id\": \"conv_8f3d1b9c2e7a4f0b9a4d2c1e6e2f8c01\",\n \"caller_id\": \"+14165550100\",\n \"called_id\": \"+12362320246\",\n \"agent_id\": \"agent_a8d3c4e09b2f4e1ab3c45f6a7b8c9d01\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-instance.example.com/api/webhook/elevenlabs/personalization")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"conversation_id\": \"conv_8f3d1b9c2e7a4f0b9a4d2c1e6e2f8c01\",\n \"caller_id\": \"+14165550100\",\n \"called_id\": \"+12362320246\",\n \"agent_id\": \"agent_a8d3c4e09b2f4e1ab3c45f6a7b8c9d01\"\n}"
response = http.request(request)
puts response.read_body{
"caller_name": "Alex Morgan",
"caller_number": "+14165550100",
"org_name": "Acme Corp"
}{
"error": "Webhook processing failed"
}Body
application/json
⌘I