Announcements

Create a new announcement

POST
https://api.tunio.ai/v1/announcements

Create a voiced announcement: Tunio renders the message with the chosen TTS voice (and the background, if any) in the background. The response has state voice_pending; poll GET /v1/announcements/{announcement_id}/status until the state is completed, then audio_url links to the finished audio on the CDN. Schedule it on a stream with POST /v1/announcements/schedules.

请求体

Announcement data

名称类型说明
background_uuidstring
Optional background music under the voice: a background_id from GET /v1/announcements/backgrounds. An unknown id gives 400 "Invalid background UUID".
background_volumenumber
Volume of the background music, 0..1. Defaults to 0.3; ignored without background_uuid.
end_datestring
Last day the announcement may play (RFC3339). The time part is dropped: the window ends at 23:59:59 of that day.
has_audio_warningboolean
Play the alert tone before and after the announcement. Defaults to false.
messageRequiredstring
Text the voice reads, required (max 500 characters).
model_idstring
Voice (model_id from GET /v1/tts/models, including the caller's cloned voices). If omitted, the default voice is used. An unknown voice gives 400 "Invalid TTS model".
speednumber
Tempo multiplier of the voice. Defaults to 1.0.
start_datestring
First day the announcement may play (RFC3339). The time part is dropped: the window starts at 00:00 of that day.
titleRequiredstring
Announcement title shown in the control panel, required (max 255 characters).
请求示例
01{
02 "background_uuid": "string",
03 "background_volume": 0.3,
04 "end_date": "2027-12-31T00:00:00Z",
05 "has_audio_warning": false,
06 "message": "Today's weather will be sunny with temperatures reaching 25°C",
07 "model_id": "string",
08 "speed": 1,
09 "start_date": "2027-01-01T00:00:00Z",
10 "title": "Daily Weather Update"
11}

响应

名称类型说明
announcement_idstring
ID of the created announcement.
statestring
Always voice_pending: the voice is generated in the background. Poll GET /v1/announcements/{announcement_id}/status until it is completed to get audio_url.
successboolean
Always true.
名称类型说明
errorsobject
Field errors keyed by JSON field name, set with validation_error.
max_lengthinteger
Maximum length in characters, set with "Title is too long" (255) and "Message is too long" (500).
messagestring
Error: validation_error, "Title is too long", "Message is too long", "Invalid TTS model", "Invalid background UUID" or "Invalid background volume".
successboolean
Always false.
名称类型说明
messagestring
Error code or human-readable error details.
successboolean
Always false for error payloads.
名称类型说明
messagestring
Error code or human-readable error details.
successboolean
Always false for error payloads.