Replaces the audio of the MoH file at index with an uploaded file or a base64 file, or changes only its description. The index does not change.Requires Office Manager, Call Center Supervisor, Reseller, or Super User. Site Manager can read domain MoH but gets 403 on a change, and so do Basic User and the read-only scopes.The file is written on the server that handles the request, before the response, and copied to the other servers over the service bus (SBUS) file journal. The call answers 202 by default. Send synchronous=yes to get 200 with the stored file instead. Every upload is converted to 8 kHz, 8-bit, mono mu-law WAV. Audio that cannot be converted returns 400 and nothing is stored.Upload a file. Send multipart/form-data with the audio in the file part (File also works). The part's Content-Type picks the decoder: audio/mpeg or audio/mp3 is decoded as MP3, audio/ogg, audio/webm, video/ogg, video/webm and application/ogg as Ogg or WebM, and anything else is read as WAV.Base64 file. Send JSON with the audio as base64 in file-base64, with no line breaks, and its format in file-encoding: audio/wav (the default), audio/mpeg, audio/ogg, or audio/webm. Base64 that does not decode, or another encoding, returns 400.With a file, file-script-text replaces the description; leave it out to keep the stored one.Description only. Send JSON with file-script-text and no file. Only the description changes: the audio stays as it is and nothing is spoken, so text-to-speech fields are ignored. A request with neither audio nor file-script-text changes nothing and still answers 202. To replace the audio with text to speech, POST to the same index on /domains/{domain}/moh instead; a POST with an index that is in use overwrites it.An index with no file returns 404. Add a file with POST on /domains/{domain}/moh.
Request
Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Path Params
Body Params
multipart/form-data
Required
Responses
🟢202Accepted
application/json
The file is replaced on this server and is being copied to the others.