Adds a greeting to the box, spoken from text by a voice or recorded, at its first free digit, and answers 201 with it. Anyone who may open the box may add one; a box holds up to 9.
Spoken: send text and tts_voice_id (a voice of GET /tts_voices), and optionally style. Try the words first with POST /tts_voices/{tts_voice_id}/preview: a greeting made right after its preview reuses that audio.
Recorded: upload the audio to /files first, then send its file_id. Here, a 16 kHz mono 16-bit PCM WAV, as phones record:
POST /files?filename=greeting.wav
Content-Type: audio/wav
Content-Length: 288044
<the WAV file's bytes>{ "data": { "id": "2f9c4b1e-7a3d-4e5f-8b6c-0d2e4f6a8b1c", "filename": "greeting.wav", "content_type": "audio/wav", "size_bytes": 288044, "expires_at": "2026-11-25T15:30:00.000Z" } }then
POST /voicemail_boxes/b3f1c2a9-7d4e-4a8b-9c6f-2e5d8a1b4c70/greetings
Idempotency-Key: 8e2b4d6f-1a3c-4e5a-9b7d-3f5a7c9e1b24
Content-Type: application/json
{ "file_id": "2f9c4b1e-7a3d-4e5f-8b6c-0d2e4f6a8b1c", "name": "After hours" }The file is used once: the greeting has its own copy, and the upload is gone.
What can go wrong with the file: expired (24 hours after its upload), already used, uploaded with other credentials or in another account: 404 reference_not_found (param: file_id), upload it again. Not audio/wav or audio/mpeg: 415 media_type_unsupported. Over 10 MB: 413 request_too_large. Bytes that aren't a WAV or an MP3: 400 media_invalid, check how the file was written. POST /files itself refuses a body whose bytes don't match its Content-Type (400 media_invalid) and one over 25 MB.
make_default: true makes it the box's default greeting at once, false only adds it. Left out, it becomes the default only while callers hear the standard greeting, so a box's first greeting goes live and a later one can be prepared ahead. Send the box's etag as If-Match to add it only if the box is unchanged.
Notes:
- Send
Idempotency-Key: a retry after a lost answer then never adds a second greeting. - If the voice can't speak just now, the answer is
503 try_againand nothing was added. - Every answer carries
X-Request-IdandCache-Control: private, no-store.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
