Omnix

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
    filter Object No Optional query filter object. The schema allows an arbitrary object shape.
    sort Object No Optional sort object. The schema allows an arbitrary object shape.
    page Number No Page number. Defaults to 1 when omitted.
    pageSize Number No Number of records per page. Defaults to 50 when 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
    name String Yes Friendly display name for the audio file. Must be present in the schema.
    group String Yes Group used to organize the file. Must be present in the schema.
    description String Yes 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.
    text String Yes Text to synthesize into speech. Must contain at least 1 character.
    voiceId String Yes 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
    name String Yes Friendly display name for the audio file. Must be present in the schema.
    group String Yes Group used to organize the file. Must be present in the schema.
    description String Yes 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.
    uploadKey String Yes 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
    _id String Yes 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
    _id String Yes Identifier of the audio file to update.
    name String No New display name.
    group String No New grouping label.
    description String No 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
    text String Yes Text to synthesize. Must contain at least 1 character.
    voiceId String Yes 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
    bucketName String Yes Bucket name used to resolve the download URL.
    objectName String Yes 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",
        "