Alberto
06/02/2025, 9:05 AMAlberto
06/02/2025, 11:00 PMShubham Bajaj
06/03/2025, 2:55 AMgetCall
API response when R2 is activated:
API Response Fields (These Stay the Same)
json
{
"artifact": {
"recordingUrl": "URL_CHANGES_HERE",
"stereoRecordingUrl": "URL_CHANGES_HERE",
"recording": {
"mono": {
"combinedUrl": "URL_CHANGES_HERE",
"assistantUrl": "URL_CHANGES_HERE",
"customerUrl": "URL_CHANGES_HERE"
},
"stereoUrl": "URL_CHANGES_HERE"
}
}
}
URL Structure Changes
WITHOUT R2 (Default Vapi Storage):
json
{
"artifact": {
"recordingUrl": "https://storage.vapi.ai/recordings/call-123-mono.wav",
"stereoRecordingUrl": "https://storage.vapi.ai/recordings/call-123-stereo.wav",
"recording": {
"mono": {
"combinedUrl": "https://storage.vapi.ai/recordings/call-123-mono.wav",
"assistantUrl": "https://storage.vapi.ai/recordings/call-123-assistant.wav",
"customerUrl": "https://storage.vapi.ai/recordings/call-123-customer.wav"
},
"stereoUrl": "https://storage.vapi.ai/recordings/call-123-stereo.wav"
}
}
}
WITH R2 Activated:
The URL structure depends on your R2 configuration:
Option 1 - Default R2 URLs (no custom domain):
json
{
"artifact": {
"recordingUrl": "https://[your-account-id].r2.cloudflarestorage.com/[path]/call-123-mono.wav",
"stereoRecordingUrl": "https://[your-account-id].r2.cloudflarestorage.com/[path]/call-123-stereo.wav",
"recording": {
"mono": {
"combinedUrl": "https://[your-account-id].r2.cloudflarestorage.com/[path]/call-123-mono.wav",
"assistantUrl": "https://[your-account-id].r2.cloudflarestorage.com/[path]/call-123-assistant.wav",
"customerUrl": "https://[your-account-id].r2.cloudflarestorage.com/[path]/call-123-customer.wav"
},
"stereoUrl": "https://[your-account-id].r2.cloudflarestorage.com/[path]/call-123-stereo.wav"
}
}
}
Option 2 - Custom R2 Domain (if you set bucketPlan.url):
json
{
"artifact": {
"recordingUrl": "https://your-custom-domain.com/[path]/call-123-mono.wav",
"stereoRecordingUrl": "https://your-custom-domain.com/[path]/call-123-stereo.wav",
"recording": {
"mono": {
"combinedUrl": "https://your-custom-domain.com/[path]/call-123-mono.wav",
"assistantUrl": "https://your-custom-domain.com/[path]/call-123-assistant.wav",
"customerUrl": "https://your-custom-domain.com/[path]/call-123-customer.wav"
},
"stereoUrl": "https://your-custom-domain.com/[path]/call-123-stereo.wav"
}
}
}
Key Technical Details
1. Immediate Effect: Once R2 is configured, all new calls will use your R2 bucket URLs
2. Existing Calls: Previous calls will still have the old Vapi storage URLs
3. Fallback Mechanism: If R2 upload fails, Vapi automatically falls back to their default storage
4. Path Structure: Your recordings will be stored at [bucket]/[optional-path]/[recording-filename]
Configuration Impact on URLs
From the codebase analysis, the URL generation logic is:
// If you provide a custom URL in bucketPlan.url:
url = ${credential.bucketPlan.url}/${path}
// If no custom URL provided:
url = https://${credential.accountId}.r2.cloudflarestorage.com/${path}
Alberto
06/04/2025, 6:19 AM