Skip to content

Upload Voice

POST /api/voices/upload

Upload a new voice audio file via the API. The voice will be created with pending status and must be approved by an admin before it can be used in broadcasts. This endpoint uses multipart/form-data encoding for file upload.

Parameter Type Required Description
name string Yes Unique name for the voice (1-255 chars). Names are case-insensitive and must be unique per account.
audio file Yes Audio file (max 10MB). Supported formats: mp3, wav, ogg, m4a, aac, webm, flac.
Terminal window
curl -X POST https://api.awajdigital.com/api/voices/upload \
-H "Authorization: Bearer your_api_token_here" \
-H "Accept: application/json" \
-F "name=my_voice_name" \
-F "audio=@/path/to/your/audio.mp3"
{
"id": 4,
"name": "my_voice_name",
"status": "pending"
}

A voice with the same name already exists in your account:

{
"message": "A voice with this name already exists"
}

Audio file exceeds the 10MB size limit:

{
"message": "File size too large. Maximum allowed size is 10MB"
}

Audio file format not supported:

{
"message": "Invalid file extension. Allowed extensions: mp3, wav, ogg, m4a, aac, webm, flac"
}