Language Support
Templates can be created in multiple languages. The SDK defaults to en_US.
Specifying Language
Pass a language parameter to override the default:
// English (default)
await client.sendOtp({
to: '+918851479441',
template: 'test_welcome_template',
code: '123456',
});
// Hindi
await client.sendOtp({
to: '+918851479441',
template: 'test_welcome_template',
code: '123456',
language: 'hi_IN',
});
// Tamil
await client.sendReminder({
to: '+918851479441',
template: 'test_welcome_template',
params: ['Kumar', 'Jul 20'],
language: 'ta_IN',
});
curl -X POST https://api.convoup.com/api/v1/templates \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"to": "+918851479441",
"template_name": "test_welcome_template",
"language": "hi_IN",
"body_params": [{"type": "text", "text": "123456"}]
}'
Common Language Codes
| Language | Code |
|---|---|
| English (US) | en_US |
| English (India) | en_IN |
| Hindi | hi_IN |
| Tamil | ta_IN |
| Telugu | te_IN |
| Bengali | bn_IN |
| Marathi | mr_IN |
| Kannada | kn_IN |
| Malayalam | ml_IN |
| Gujarati | gu_IN |
Per-Language Templates
Each language variant requires a separate template approved by Meta. Create language-specific templates in the Convoup dashboard under Templates > Create Template.
For example, to support English and Hindi OTP messages:
- Create
otp_englishwith bodyYour OTP is {{1}} - Create
otp_hindiwith bodyआपका OTP {{1}} है - Submit both for Meta approval
- Send using the appropriate
languageparameter
Fallback Behavior
If you send a message with a language code that doesn't have an approved template, the API returns a TEMPLATE_NOT_FOUND error. There is no automatic fallback to another language.
Common Mistake
Sending with language: 'hi_IN' when you only have an en_US template will return TEMPLATE_NOT_FOUND. Create the language-specific template first.
Next Steps
- How Templates Work - Template structure and placeholders
- SDK vs REST - When to use the SDK vs raw HTTP
- Error Codes - Handling TEMPLATE_NOT_FOUND and other errors
