Create template
Create template
curl -X POST "https://api.example.com/open/v1/voice/template/create" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"contentType": "YOUR_CONTENT_TYPE",
"countryCode": "YOUR_COUNTRY_CODE",
"templateName": "YOUR_TEMPLATE_NAME"
}'code=000000 success; data.templateId is the new template identifier (usable once approved)
{
"code": "000000",
"data": {
"templateId": "string"
},
"message": "string"
}Documented response example from the spec, not a real request result.
Create a voice template and submit it for review (usable for sending once approved). contentType=1 text TTS (variables as {1}…{n} ordinal placeholders); contentType=2 audio file (base64 upload, mp3/wav/m4a, under 2 MB). The country is bound at template creation; the send API derives the call country from it. Error codes follow the platform six-digit scheme.
Use the InnoPaaS AppKey as a Bearer token. Create or manage keys in Console. API key guide
Authorization
Authorizationstring<bearer>requiredBody
application/jsonfileNamestringoptionalAudio file name (required for contentType=2; .mp3/.wav/.m4a)
playTimesintegeroptionalDefault playback count
1Minimum1Maximum3contentTypestringrequired1 - text TTS; 2 - audio file
countryCodestringrequiredCountry/region alpha-2 code bound to the template (send derives the country from it)
^[A-Za-z]{2}$fileContentstringoptionalAudio file base64 (required for contentType=2; under 2 MB after decoding)
ttsEngineIdintegeroptionalTTS engine ID; omit for the default engine
1templateNamestringrequiredTemplate name
50templateContentstringoptionalText template content (required for contentType=1); variables as {1}…{n}
200Response
application/jsoncode=000000 success; data.templateId is the new template identifier (usable once approved)
codestringoptionaldataobjectnulloptionalmessagestringoptional{
"code": "000000",
"data": {
"templateId": "string"
},
"message": "string"
}Documented response example from the spec, not a real request result.