ExoVoIPDeveloper guide

Voice prompts

Voice prompts are the phone system's audio files: welcome, menu, closed and announcement messages, and music on hold tracks. They can be uploaded as files or generated from text with a synthetic voice. Scopes media:read / media:write.

Uploading a file

Accepted formats: MP3, WAV, OGG, M4A, up to 20 MB. Audio is normalized and automatically converted to telephony formats; in the meantime the prompt is shown as processing.

curl -s -X POST https://centralino.exovoip.it/api/v1/prompts/upload \
  -H "X-API-Key: $EXOPBX_API_KEY" \
  -F name="Benvenuto" -F kind="prompt" -F file=@benvenuto.wav
FieldValues
kindprompt (message), announcement (announcement), moh (music track), whisper (announcement to the agent)
langit, en, de, fr, es

Generating from text

curl -s -X POST https://centralino.exovoip.it/api/v1/prompts \
  -H "X-API-Key: $EXOPBX_API_KEY" -H "Content-Type: application/json" \
  -d '{"name":"Chiusura","kind":"announcement","lang":"it",
       "text":"Grazie per aver chiamato. I nostri uffici sono chiusi, richiamare dalle 9 alle 18."}'
curl -s -X POST https://centralino.exovoip.it/api/v1/prompts/31/generate -H "X-API-Key: $EXOPBX_API_KEY"
curl -s https://centralino.exovoip.it/api/v1/jobs/88 -H "X-API-Key: $EXOPBX_API_KEY"

Generation runs in the background: POST /v1/prompts/:id/generate returns a job whose status can be read with GET /v1/jobs/:id (pending, running, done, failed). Editing the text with PATCH returns the prompt to draft until it is generated again.

GET /v1/prompts/:id/audio returns the audio for playback; usedBy in the details shows where the prompt is used (a prompt in use cannot be deleted: 409 IN_USE).

Choosing the voice

GET /v1/voices lists the voices available for text prompts, default voice first. Filters: lang (it, en, de, fr, es) and gender (female, male, neutral). Each voice has a name, gender, age, tone, suggested use and languages; isDefault marks the voice used when a prompt does not specify one. The catalog updates automatically once a day.

  • Preview: GET /v1/voices/:voiceId/preview returns a short MP3 sample (with ETag and 24-hour caching).
  • Try your own text: POST /v1/voices/:voiceId/sample with { "text": "...", "lang": "en" } (up to 200 characters) returns WAV audio. Tries are limited to 20 per day per company (429 RATE_LIMITED beyond the limit); a sentence already played does not count. The X-Samples-Remaining header shows the tries left.
  • Company default voice: PUT /v1/voices/default with { "voiceId": "..." }; null goes back to the platform's recommended voice.

To use a voice in a prompt, pass voiceId in POST /v1/prompts or PATCH /v1/prompts/:id (an unavailable voice returns 400 VALIDATION_ERROR). Without voiceId the prompt uses the company default voice.

Endpoints

RequestScopeSDK method
GET /v1/jobs/:idmedia:readjobs.get()
GET /v1/promptsmedia:readprompts.list()
POST /v1/promptsmedia:writeprompts.createTts() · py: prompts.create_tts()
POST /v1/prompts/uploadmedia:writeprompts.upload()
GET /v1/prompts/:idmedia:readprompts.get()
PATCH /v1/prompts/:idmedia:writeprompts.update()
DELETE /v1/prompts/:idmedia:writeprompts.delete()
POST /v1/prompts/:id/generatemedia:writeprompts.generate()
GET /v1/prompts/:id/audiomedia:readprompts.audio()
GET /v1/voicesmedia:readvoices.list()
POST /v1/voices/syncsystem:writevoices.sync()
PUT /v1/voices/defaultmedia:writevoices.setTenantDefault() · py: voices.set_tenant_default()
PUT /v1/voices/platform-defaultsystem:writevoices.setPlatformDefault() · py: voices.set_platform_default()
GET /v1/voices/:voiceId/previewmedia:readvoices.preview()
POST /v1/voices/:voiceId/samplemedia:writevoices.sample()