Skip to main content
POST
/
v2
/
tts
/
voices
Create TTS voice
curl --request POST \
  --url https://api.tryhamsa.com/v2/tts/voices \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Support Assistant Female",
  "audioUrl": "https://cdn.tryhamsa.com/uploads/voice.wav",
  "audioTranscription": "مرحباً، أنا مساعدك الصوتي.",
  "projectId": "ae6d58c6-c6bd-4ae0-ad74-b8b39c29928b",
  "language": "ar",
  "tags": [
    "female",
    "conversational"
  ],
  "description": "Friendly female assistant voice",
  "imageUrl": "https://cdn.tryhamsa.com/voices/avatar.png",
  "dialectId": "ae6d58c6-c6bd-4ae0-ad74-b8b39c29928b"
}
'
{
  "success": true,
  "message": "Operation completed successfully",
  "messageKey": "OPERATION_SUCCESSFUL",
  "data": {
    "id": "48f7656f-098b-4c43-b165-7cfd2cc8ac30",
    "voiceRecord": "test.wav"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.tryhamsa.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Pass the API key in the Authorization header, You need to put Token keyword before the API key. e.g. 'Authorization: Token '

Body

application/json
name
string
required

Voice name (Arabic & English letters and numbers only)

Required string length: 1 - 190
Example:

"Support Assistant Female"

audioUrl
string<uri>
required

URL of the uploaded voice sample

Example:

"https://cdn.tryhamsa.com/uploads/voice.wav"

audioTranscription
string
required

Exact transcription of the uploaded audio sample

Required string length: 1 - 5000
Example:

"مرحباً، أنا مساعدك الصوتي."

projectId
string<uuid>
required
Example:

"ae6d58c6-c6bd-4ae0-ad74-b8b39c29928b"

language
enum<string>
required

Voice language

Available options:
en,
ar
Example:

"ar"

tags
enum<string>[]
required

Exactly 2 tags: one gender + one voice style

Required array length: 2 elements
Available options:
male,
female,
conversational,
narrator
Example:
["female", "conversational"]
description
string | null
Required string length: 1 - 1000
Example:

"Friendly female assistant voice"

imageUrl
string<uri> | null

Optional avatar image for the voice

Example:

"https://cdn.tryhamsa.com/voices/avatar.png"

dialectId
string<uuid> | null

Required when language is 'ar'. Must be omitted when language is 'en'.

Example:

"ae6d58c6-c6bd-4ae0-ad74-b8b39c29928b"

Response

Voice created successfully.

success
boolean
Example:

true

message
string
Example:

"Operation completed successfully"

messageKey
string
Example:

"OPERATION_SUCCESSFUL"

data
object