danemyers
04/03/2025, 9:38 PMVapi Support Bot
04/03/2025, 9:40 PMbash
# Using the GET /call/:id endpoint
curl -X GET 'https://api.vapi.ai/call/{callId}' \
-H 'Authorization: Bearer YOUR_API_KEY'
Or through code:
typescript
const downloadRecording = async () => {
// Fetch call data to get artifact URLs
const call = await vapiClient.calls.get(callId);
if (call.artifact?.recordingUrl) {
// Access the recording URL
const recordingUrl = call.artifact.recordingUrl;
}
};
According to the [documentation](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342498699615539222), you can also configure your assistant's serverMessages
to include "end-of-call-report"
to receive the recording URL via webhooks.
### 2. Enabling Call Recording
Make sure recording is enabled in your assistant's configuration:
javascript
// Configure your assistant's artifactPlan with recordingEnabled: true
const assistantConfig = {
artifactPlan: {
recordingEnabled: true
}
// other configuration...
};
### 3. Playing Audio Through the Call Stream
To play audio through a Vapi call, you can use websockets to stream the audio. Here's a simplified approach based on the [websocket streaming documentation](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341810370700120064):
```javascript
// Establish transport connection first
const vapiTransport = new WebSocket(wss://api.vapi.ai/call/${callId}/transport
);Vapi Support Bot
04/03/2025, 9:40 PMwss://api.vapi.ai/call/${callId}/listen
);
// To send audio data to the call (your recording snippet)
function sendAudioSnippet(audioData) {
if (vapiTransport.readyState === WebSocket.OPEN) {
vapiTransport.send(audioData);
}
}
```
You would need to process your recording externally to extract the specific snippet you want to play, then stream that snippet through the websocket connection.
Is there anything specific about this process you'd like me to clarify further?
Sources:
- [Discord Thread on Call Recordings](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1342498699615539222)
- [Discord Thread on Audio Streaming](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341810370700120064)
- [Discord Thread on Call Data Access](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341440757189578782)danemyers
04/03/2025, 11:12 PMKyle
04/06/2025, 11:49 AMKyle
04/06/2025, 11:56 AMdanemyers
04/07/2025, 4:39 PMKyle
04/09/2025, 12:59 AM