Call outcome webhook
curl --request POST \
--url https://app.freyavoice.ai/api/v2/webhooks/campaign-call-outcome \
--header 'Content-Type: application/json' \
--data '
{
"campaignId": "<string>",
"phoneNumber": "<string>",
"callId": "<string>",
"failureCategory": "<string>",
"message": "<string>",
"willRetry": true,
"retryScheduledAt": "2023-11-07T05:31:56Z",
"retriesRemaining": 123,
"attemptNumber": 123
}
'import requests
url = "https://app.freyavoice.ai/api/v2/webhooks/campaign-call-outcome"
payload = {
"campaignId": "<string>",
"phoneNumber": "<string>",
"callId": "<string>",
"failureCategory": "<string>",
"message": "<string>",
"willRetry": True,
"retryScheduledAt": "2023-11-07T05:31:56Z",
"retriesRemaining": 123,
"attemptNumber": 123
}
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({
campaignId: '<string>',
phoneNumber: '<string>',
callId: '<string>',
failureCategory: '<string>',
message: '<string>',
willRetry: true,
retryScheduledAt: '2023-11-07T05:31:56Z',
retriesRemaining: 123,
attemptNumber: 123
})
};
fetch('https://app.freyavoice.ai/api/v2/webhooks/campaign-call-outcome', 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://app.freyavoice.ai/api/v2/webhooks/campaign-call-outcome",
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([
'campaignId' => '<string>',
'phoneNumber' => '<string>',
'callId' => '<string>',
'failureCategory' => '<string>',
'message' => '<string>',
'willRetry' => true,
'retryScheduledAt' => '2023-11-07T05:31:56Z',
'retriesRemaining' => 123,
'attemptNumber' => 123
]),
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://app.freyavoice.ai/api/v2/webhooks/campaign-call-outcome"
payload := strings.NewReader("{\n \"campaignId\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"callId\": \"<string>\",\n \"failureCategory\": \"<string>\",\n \"message\": \"<string>\",\n \"willRetry\": true,\n \"retryScheduledAt\": \"2023-11-07T05:31:56Z\",\n \"retriesRemaining\": 123,\n \"attemptNumber\": 123\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://app.freyavoice.ai/api/v2/webhooks/campaign-call-outcome")
.header("Content-Type", "application/json")
.body("{\n \"campaignId\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"callId\": \"<string>\",\n \"failureCategory\": \"<string>\",\n \"message\": \"<string>\",\n \"willRetry\": true,\n \"retryScheduledAt\": \"2023-11-07T05:31:56Z\",\n \"retriesRemaining\": 123,\n \"attemptNumber\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.freyavoice.ai/api/v2/webhooks/campaign-call-outcome")
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 \"campaignId\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"callId\": \"<string>\",\n \"failureCategory\": \"<string>\",\n \"message\": \"<string>\",\n \"willRetry\": true,\n \"retryScheduledAt\": \"2023-11-07T05:31:56Z\",\n \"retriesRemaining\": 123,\n \"attemptNumber\": 123\n}"
response = http.request(request)
puts response.read_bodyWebhooks
Call outcome webhook
Sent to the campaign’s webhookUrl when a call completes or fails.
Payload Types:
- WebhookCallOutcome: Sent when a call completes (success or failure with ended_reason)
- WebhookApiError: Sent when call initiation fails before a call is created
Failure Categories:
no_answer: Customer didn’t answerbusy: Line was busyvoicemail: Reached voicemailtimeout: Call timed out (infrastructure)api_error: API call failed before call startedllm_fail: LLM evaluation failed (if successPrompt configured)other: Unknown failure
Retry Behavior:
- If
willRetry: true, checkretryScheduledAtfor next attempt time - Retries respect the campaign’s schedule (activeDays, startTime, endTime, and daySchedules overrides)
retriesRemainingshows how many retries are left
POST
/
webhooks
/
campaign-call-outcome
Call outcome webhook
curl --request POST \
--url https://app.freyavoice.ai/api/v2/webhooks/campaign-call-outcome \
--header 'Content-Type: application/json' \
--data '
{
"campaignId": "<string>",
"phoneNumber": "<string>",
"callId": "<string>",
"failureCategory": "<string>",
"message": "<string>",
"willRetry": true,
"retryScheduledAt": "2023-11-07T05:31:56Z",
"retriesRemaining": 123,
"attemptNumber": 123
}
'import requests
url = "https://app.freyavoice.ai/api/v2/webhooks/campaign-call-outcome"
payload = {
"campaignId": "<string>",
"phoneNumber": "<string>",
"callId": "<string>",
"failureCategory": "<string>",
"message": "<string>",
"willRetry": True,
"retryScheduledAt": "2023-11-07T05:31:56Z",
"retriesRemaining": 123,
"attemptNumber": 123
}
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({
campaignId: '<string>',
phoneNumber: '<string>',
callId: '<string>',
failureCategory: '<string>',
message: '<string>',
willRetry: true,
retryScheduledAt: '2023-11-07T05:31:56Z',
retriesRemaining: 123,
attemptNumber: 123
})
};
fetch('https://app.freyavoice.ai/api/v2/webhooks/campaign-call-outcome', 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://app.freyavoice.ai/api/v2/webhooks/campaign-call-outcome",
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([
'campaignId' => '<string>',
'phoneNumber' => '<string>',
'callId' => '<string>',
'failureCategory' => '<string>',
'message' => '<string>',
'willRetry' => true,
'retryScheduledAt' => '2023-11-07T05:31:56Z',
'retriesRemaining' => 123,
'attemptNumber' => 123
]),
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://app.freyavoice.ai/api/v2/webhooks/campaign-call-outcome"
payload := strings.NewReader("{\n \"campaignId\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"callId\": \"<string>\",\n \"failureCategory\": \"<string>\",\n \"message\": \"<string>\",\n \"willRetry\": true,\n \"retryScheduledAt\": \"2023-11-07T05:31:56Z\",\n \"retriesRemaining\": 123,\n \"attemptNumber\": 123\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://app.freyavoice.ai/api/v2/webhooks/campaign-call-outcome")
.header("Content-Type", "application/json")
.body("{\n \"campaignId\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"callId\": \"<string>\",\n \"failureCategory\": \"<string>\",\n \"message\": \"<string>\",\n \"willRetry\": true,\n \"retryScheduledAt\": \"2023-11-07T05:31:56Z\",\n \"retriesRemaining\": 123,\n \"attemptNumber\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.freyavoice.ai/api/v2/webhooks/campaign-call-outcome")
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 \"campaignId\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"callId\": \"<string>\",\n \"failureCategory\": \"<string>\",\n \"message\": \"<string>\",\n \"willRetry\": true,\n \"retryScheduledAt\": \"2023-11-07T05:31:56Z\",\n \"retriesRemaining\": 123,\n \"attemptNumber\": 123\n}"
response = http.request(request)
puts response.read_bodyBody
application/json
Available options:
success, failed SipCodeCategory value or 'api_error' if outcome is 'failed'
Contextual message: ended_reason, timeout message, or LLM evaluation reason
Whether the call will be retried
ISO8601 timestamp when retry is scheduled
Number of retries remaining
Which attempt this outcome is for (1-indexed)
Response
200
Webhook received successfully