Integrate callvine.ai with your system using our webhook API to automatically sync call logs and data
The callvine.ai Webhook API allows you to programmatically create call log entries by sending POST requests with call data. This is perfect for integrating with phone systems, CRM platforms, or any application that handles call data.
Authentication is handled via API keys sent in the request headers. You can include your API key in either of these headers:
X-API-Key: your_api_key_here
Authorization: Bearer your_api_key_here
https://callvine.ai/webhook.php
Content-Type: application/json
CORS: Enabled for cross-origin requests
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
from_phone |
string | Required | Caller's phone number or identifier | "9087270291" |
to_phone |
string | Required | Called party's phone number or identifier | "8006000009" |
handled_by |
string | Required | Name of the agent who handled the call | "Agent Smith" |
start_time |
string | Required | Call start time in YYYY-MM-DD HH:MM:SS format | "2024-01-15 09:00:00" |
end_time |
string | Required | Call end time in YYYY-MM-DD HH:MM:SS format | "2024-01-15 09:15:00" |
recording_url |
string | Required | URL to the call recording file | "https://example.com/call.wav" |
department |
string | Optional | Department or team that handled the call | "Customer Service" |
Choose your preferred programming language to see the implementation example:
curl -X POST https://callvine.ai/webhook.php \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{
"from_phone": "9087270291",
"to_phone": "8006000009",
"handled_by": "Agent Smith",
"department": "Customer Service",
"start_time": "2024-01-15 09:00:00",
"end_time": "2024-01-15 09:15:00",
"recording_url": "https://example.com/recordings/call123.wav"
}'
const response = await fetch('https://callvine.ai/webhook.php', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'your_api_key_here'
},
body: JSON.stringify({
from_phone: '9087270291',
to_phone: '8006000009',
handled_by: 'Agent Smith',
department: 'Customer Service',
start_time: '2024-01-15 09:00:00',
end_time: '2024-01-15 09:15:00',
recording_url: 'https://example.com/recordings/call123.wav'
})
});
const result = await response.json();
console.log(result);
import requests
import json
url = 'https://callvine.ai/webhook.php'
headers = {
'Content-Type': 'application/json',
'X-API-Key': 'your_api_key_here'
}
data = {
'from_phone': '9087270291',
'to_phone': '8006000009',
'handled_by': 'Agent Smith',
'department': 'Customer Service',
'start_time': '2024-01-15 09:00:00',
'end_time': '2024-01-15 09:15:00',
'recording_url': 'https://example.com/recordings/call123.wav'
}
response = requests.post(url, headers=headers, json=data)
result = response.json()
print(result)
$url = 'https://callvine.ai/webhook.php';
$data = [
'from_phone' => '9087270291',
'to_phone' => '8006000009',
'handled_by' => 'Agent Smith',
'department' => 'Customer Service',
'start_time' => '2024-01-15 09:00:00',
'end_time' => '2024-01-15 09:15:00',
'recording_url' => 'https://example.com/recordings/call123.wav'
];
$options = [
'http' => [
'header' => [
'Content-Type: application/json',
'X-API-Key: your_api_key_here'
],
'method' => 'POST',
'content' => json_encode($data)
]
];
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
$response = json_decode($result, true);
The API returns different response formats based on success or failure. Choose a category to see the specific response examples:
Upon successful creation, the API returns the complete call log data including the unique ID that can be used for future references or analysis.
{
"success": true,
"message": "Call log created successfully",
"data": {
"id": 123,
"from_phone": "9087270291",
"to_phone": "8006000009",
"handled_by": "Agent Smith",
"department": "Customer Service",
"start_time": "2024-01-15 09:00:00",
"end_time": "2024-01-15 09:15:00",
"recording_url": "https://example.com/recordings/call123.wav",
"title": "Call from 9087270291 to 8006000009 (handled by Agent Smith)",
"created_at": "2024-01-15 10:30:00"
}
}
Field | Type | Description |
---|---|---|
success |
boolean | Always true for successful requests |
message |
string | Human-readable success message |
data.id |
integer | Unique identifier of the created call log (use for analysis: recording.php?call_id=123) |
data.* |
various | Echo of the submitted call data plus generated fields |
These errors indicate issues with the request data or authentication:
{
"error": "Missing required fields",
"message": "The following fields are required: from_phone, handled_by, recording_url",
"missing_fields": ["from_phone", "handled_by", "recording_url"]
}
{
"error": "Invalid start_time format",
"message": "start_time must be in YYYY-MM-DD HH:MM:SS format",
"example": "2024-01-15 09:00:00"
}
{
"error": "Invalid time range",
"message": "end_time must be after start_time"
}
{
"error": "Invalid recording URL",
"message": "recording_url must be a valid URL"
}
{
"error": "Invalid JSON",
"message": "Request body must be valid JSON"
}
{
"error": "Authentication required",
"message": "API key must be provided in X-API-Key header or Authorization header"
}
{
"error": "Invalid API key",
"message": "The provided API key is not valid"
}
{
"error": "Method not allowed",
"message": "This endpoint only accepts POST requests",
"allowed_methods": ["POST"]
}
These errors indicate issues on the server side:
{
"error": "Database error",
"message": "Failed to insert call log into database"
}
{
"error": "Internal server error",
"message": "An unexpected error occurred while processing the request"
}
Call log was successfully created
Invalid request data or missing required fields
Missing or invalid API key
Only POST requests are accepted
Server error occurred while processing request
For detailed JSON response examples, see the Response Examples section above which contains organized tabs for success and error responses.
For testing purposes, you can use these test API keys:
Test API Key: test_key_123
Production API Key: prod_key_456
If you have questions about the webhook API or need assistance with integration, please contact our support team or check the main dashboard for additional resources.