AudioFileManagerRpc
This RPC group provides endpoints for listing, creating, updating, deleting, and obtaining upload/download access for telephony audio files. It also supports generating text-to-speech previews and creating stored audio-file records from either TTS output or finalized uploads.
Endpoints
POST /api/rpc (Method: AudioFileManagerRpc.getData)
Description: Lists audio files for the current subscription.
Request Body:
{ "method": "AudioFileManagerRpc.getData", "params": { "filter": {}, "sort": {}, "page": 1, "pageSize": 50 } }Parameters:
Name Type Required Description filterObjectNo Optional query filter object. The schema allows an arbitrary object shape. sortObjectNo Optional sort object. The schema allows an arbitrary object shape. pageNumberNo Page number. Defaults to 1when omitted.pageSizeNumberNo Number of records per page. Defaults to 50when omitted.Response:
{ "success": true, "data": { "...": "Data returned by the telephony audio-file listing operation" } }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "AudioFileManagerRpc.getData", "params": { "page": 1, "pageSize": 50 } }'
POST /api/rpc (Method: AudioFileManagerRpc.createFromTTSWithVoice)
Description: Creates an audio file from text using a selected voice.
Request Body:
{ "method": "AudioFileManagerRpc.createFromTTSWithVoice", "params": { "name": "Greeting", "group": "tts", "description": "Welcome message", "text": "Hello, thank you for calling.", "voiceId": "voice-model-id" } }Parameters:
Name Type Required Description nameStringYes Friendly display name for the audio file. Must be present in the schema. groupStringYes Group used to organize the file. Must be present in the schema. descriptionStringYes Description for the audio file. Must be present in the schema. The underlying schema allows this field to be optional and nullable, but this RPC’s request schema includes it through the picked base schema. textStringYes Text to synthesize into speech. Must contain at least 1 character. voiceIdStringYes Composite voice identifier. Must contain at least 1 character and is parsed before synthesis. Response:
{ "success": true, "data": { "...": "Result returned by the audio-file registration operation" } }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "AudioFileManagerRpc.createFromTTSWithVoice", "params": { "name": "Greeting", "group": "tts", "description": "Welcome message", "text": "Hello, thank you for calling.", "voiceId": "voice-model-id" } }'
POST /api/rpc (Method: AudioFileManagerRpc.createFromUpload)
Description: Creates an audio file record from a finalized upload.
Request Body:
{ "method": "AudioFileManagerRpc.createFromUpload", "params": { "name": "Hold Music", "group": "music", "description": "Uploaded hold music", "uploadKey": "upload-key-value" } }Parameters:
Name Type Required Description nameStringYes Friendly display name for the audio file. Must be present in the schema. groupStringYes Group used to organize the file. Must be present in the schema. descriptionStringYes Description for the audio file. Must be present in the schema. The underlying schema allows this field to be optional and nullable, but this RPC’s request schema includes it through the picked base schema. uploadKeyStringYes Finalized upload key. Must contain at least 1 character. Response:
{ "success": true, "data": { "...": "Result returned by the audio-file registration operation" } }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "AudioFileManagerRpc.createFromUpload", "params": { "name": "Hold Music", "group": "music", "description": "Uploaded hold music", "uploadKey": "upload-key-value" } }'
POST /api/rpc (Method: AudioFileManagerRpc.delete)
Description: Deletes an audio file and its corresponding object in storage.
Request Body:
{ "method": "AudioFileManagerRpc.delete", "params": { "_id": "audio-file-id" } }Parameters:
Name Type Required Description _idStringYes Identifier of the audio file to delete. Response:
{ "success": true, "data": { "...": "Result returned by the delete operation" } }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "AudioFileManagerRpc.delete", "params": { "_id": "audio-file-id" } }'
POST /api/rpc (Method: AudioFileManagerRpc.update)
Description: Updates an audio file's metadata (name, group, description).
Request Body:
{ "method": "AudioFileManagerRpc.update", "params": { "_id": "audio-file-id", "name": "Updated name", "group": "updated-group", "description": "Updated description" } }Parameters:
Name Type Required Description _idStringYes Identifier of the audio file to update. nameStringNo New display name. groupStringNo New grouping label. descriptionStringNo New description. Response:
{ "success": true, "data": { "...": "Result returned by the audio-file update operation" } }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "AudioFileManagerRpc.update", "params": { "_id": "audio-file-id", "name": "Updated name" } }'
POST /api/rpc (Method: AudioFileManagerRpc.previewTTSWithVoice)
Description: Generates a TTS audio preview without saving it, using a selected voice.
Request Body:
{ "method": "AudioFileManagerRpc.previewTTSWithVoice", "params": { "text": "Hello, thank you for calling.", "voiceId": "voice-model-id" } }Parameters:
Name Type Required Description textStringYes Text to synthesize. Must contain at least 1 character. voiceIdStringYes Composite voice identifier. Must contain at least 1 character and is parsed before synthesis. Response:
{ "success": true, "data": { "audioDataUrl": "data:audio/mpeg;base64,..." } }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "AudioFileManagerRpc.previewTTSWithVoice", "params": { "text": "Hello, thank you for calling.", "voiceId": "voice-model-id" } }'
POST /api/rpc (Method: AudioFileManagerRpc.getPresignedUrl)
Description: Gets a temporary, secure URL to play/download an audio file.
Request Body:
{ "method": "AudioFileManagerRpc.getPresignedUrl", "params": { "bucketName": "audio-bucket", "objectName": "audio/subscription/group/file.mp3" } }Parameters:
Name Type Required Description bucketNameStringYes Bucket name used to resolve the download URL. objectNameStringYes Object key or path inside the bucket. Response:
{ "success": true, "data": { "url": "https://temporary-download-url" } }Example (cURL):
curl -X POST "${APP_BASE_URL}/api/rpc" \ -H "Content-Type: application/json" \ -d '{ "method": "AudioFileManagerRpc.getPresignedUrl", "