Uploading Audio
How to upload audio files for processing
ComsWise uses a 2-step direct-to-cloud upload process to ensure speed and security.
- Request Upload URL: Get a signed URL to upload your file.
- Upload File: PUT the file content to that URL.
Step 1: Request Upload URL
Send a POST request to /upload/request with the file metadata.
Endpoint: POST /upload/request
curl https://api.comswise.in/v1/upload/request \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fileName": "call_recording.wav",
"contentType": "audio/wav"
}'Response:
{
"uploadUrl": "https://r2.cloudflarestorage.com/comswise-uploads/org_123/...",
"fileKey": "org_123/uploads/uuid.wav"
}[!IMPORTANT] Save the
fileKey. You will need it to create the Call record in the next step.
Step 2: Upload File
Upload the file binary to the uploadUrl provided in the previous step.
curl -X PUT "{uploadUrl}" \
-H "Content-Type: audio/wav" \
--data-binary @call_recording.wavOnce the upload is complete (HTTP 200 OK), you can proceed to create the call record.