Stream Conversation Audio
curl --request GET \
--url https://api.inya.ai/platform/v1/conversations/{conversationId}/audio \
--header 'x-api-key: <api-key>'import requests
url = "https://api.inya.ai/platform/v1/conversations/{conversationId}/audio"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.inya.ai/platform/v1/conversations/{conversationId}/audio', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));"<string>"{
"status": "failure",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "<string>"
}{
"status": "failure",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "<string>"
}{
"status": "failure",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "<string>"
}Conversations API
Get Conversation Audio
Stream or download the audio recording of a specific conversation
GET
/
v1
/
conversations
/
{conversationId}
/
audio
Stream Conversation Audio
curl --request GET \
--url https://api.inya.ai/platform/v1/conversations/{conversationId}/audio \
--header 'x-api-key: <api-key>'import requests
url = "https://api.inya.ai/platform/v1/conversations/{conversationId}/audio"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.inya.ai/platform/v1/conversations/{conversationId}/audio', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));"<string>"{
"status": "failure",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "<string>"
}{
"status": "failure",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "<string>"
}{
"status": "failure",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "<string>"
}What it does: Retrieve the audio recording of a completed conversation as a binary stream. The response body contains the raw audio data (
404 Not Found — Audio recording not available
The path in the message is server-specific. A
audio/mpeg) which can be streamed directly to an audio player, downloaded as an MP3, or processed programmatically for transcription or archiving.
Required Permission
conversations
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
conversationId | string | Yes | Unique identifier of the conversation. |
Minimum working example
Download the recording as an MP3 file:curl -H "x-api-key: <your_api_key>" \
"https://api.inya.ai/platform/v1/conversations/1786433682702486082/audio" \
--output conversation.mp3
Additional examples
Stream and play (JavaScript)
const response = await fetch(
'https://api.inya.ai/platform/v1/conversations/1786433682702486082/audio',
{ headers: { 'x-api-key': '<your_api_key>' } }
);
const blob = await response.blob();
const audioUrl = URL.createObjectURL(blob);
const audio = new Audio(audioUrl);
audio.play();
Stream and save (Python)
import requests
response = requests.get(
'https://api.inya.ai/platform/v1/conversations/1786433682702486082/audio',
headers={'x-api-key': '<your_api_key>'},
stream=True
)
with open('conversation.mp3', 'wb') as f:
for chunk in response.iter_content(chunk_size=8192):
f.write(chunk)
Response
Success (200)
Returns the audio recording as a binary stream withContent-Type: audio/mpeg. The response body is the raw MP3 data. Use GET (not HEAD) when checking availability — some deployments return 405 for HEAD requests.
Errors
403 Forbidden — Insufficient permissions{
"status": "failure",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "User does not have access to this conversation"
}
{
"status": "failure",
"requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message": "Audio file not found at path: /gnanicallshare/dev-.../conversation-id.mp3"
}
404 means no recording exists for this conversation.
Edge cases
| Scenario | What happens |
|---|---|
| Recording disabled for agent | HTTP 404 |
| Call too short to record | HTTP 404 |
Using HEAD request | May return HTTP 405 on some deployments — use GET |
Audio recordings may contain sensitive personal information. Ensure proper access controls are in place and comply with applicable data privacy regulations before storing or sharing recordings.
Save the
requestId from every response. You will need it if you contact Gnani support to trace a specific request.Was this page helpful?