Skip to main content
POST
/
v2
/
tts
/
histories
Create TTS history
curl --request POST \
  --url https://api.tryhamsa.com/v2/tts/histories \
  --header 'Content-Type: application/json' \
  --data '
{
  "ttsVoiceId": "633f19a6-089b-4950-bfab-55f5c750732e",
  "script": "مرحباً، هذا مثال على نص التحويل إلى صوت.",
  "apiKey": "9f5f1f6a-2b1d-4a33-8fd4-6f5c2b89e3aa",
  "config": {
    "speed": 1,
    "expressiveness": 1
  },
  "voiceDictionaryIds": [
    "6ac0324d-bcb9-40f3-a57a-de6da7b721c8"
  ]
}
'
{
  "success": true,
  "message": "Operation completed successfully",
  "messageKey": "OPERATION_SUCCESSFUL",
  "data": []
}

Body

application/json
ttsVoiceId
string<uuid>
required

TTS voice identifier

Example:

"633f19a6-089b-4950-bfab-55f5c750732e"

script
string
required

Text to be synthesized. Must contain real Arabic or English text.

Required string length: 1 - 3000
Example:

"مرحباً، هذا مثال على نص التحويل إلى صوت."

apiKey
string<uuid>
required

API key identifier (used for API key authorization)

Example:

"9f5f1f6a-2b1d-4a33-8fd4-6f5c2b89e3aa"

config
object

Optional voice generation configuration

Example:
{ "speed": 1, "expressiveness": 1 }
voiceDictionaryIds
string<uuid>[]

Optional list of voice dictionary identifiers

Required array length: 1 - 10 elements

Response

History created successfully.

success
boolean
Example:

true

message
string
Example:

"Operation completed successfully"

messageKey
string
Example:

"OPERATION_SUCCESSFUL"

data
array
Example:
[]