Verify supported languages
Language translations are defined by a locale value, also known as a "language tag". For example, the locale value for English (American) is en.
For any type of Verify template used, the locale will automatically resolve based on the country code of the phone number provided for Verifications sent using the SMS, Voice, or WhatsApp channels, with en or a custom template's default language as the fallback locale if a translation is not available. See a list of phone number country code to language mappings here. Using this automatic resolution is highly recommended. If a language override is desired, you can specify the locale parameter when creating a Verification.
The locale values follow country-region format as described in IETF's BPC 47 for the languages listed below. If an unsupported override locale is given, a 404 error will be returned. In that case, we recommend that you retry the request without the locale parameter to implement a fallback to the country code's default language or English.
Warning
SMS messages sent with Programmable Messaging or Verify are priced per message segment.
Messages sent in certain language locales, including pt, pt_BR, cs, and el or in non-GSM characters may be split into multiple message segments. You can check how many message segments your message will use with the Messaging Segment Calculator tool.
Learn more about how to limit message segments in our developer best practices.
Language support depends on the type of Verify template used (Verify Default, pre-approved, custom, WhatsApp copy code authentication) and the channel (SMS, Voice, RCS, or WhatsApp) through which the message is sent. Learn more about template types.
Note: Verify Email and SNA channels don't support language translations.
The Verify Default template is used automatically if no pre-approved or custom template is specified in your Verification request or set as the service default.
Pre-approved templates support only a subset of the languages available in Verify. Twilio continues to add more translations and expand language support over time.
- To check the available languages per-template via API:
- View available templates using the Get a List of Available Templates endpoint.
- Check the
translationsproperty of the template to see supported languages.
- To check the available languages per-template via Twilio Console:
- Navigate to Twilio Console > Verify > Services page and select your Verify Service.
- On the Settings page under the General tab, select a Message body under the Template configuration heading.
- Check the Message preview section for Locale Preview dropdown for a list of supported languages.
The template requester must provide translations when making a request to create a custom template.
Each translation must be mapped to a locale value. The template requester can define the locale value, but it must follow these rules:
- The locale value must be in XX (e.g.
pt) or XX-XX (e.g.pt-br) format. - The locale value must use locale "component" values as defined by IETF's BPC 47.
WhatsApp OTP messages are sent via WhatsApp copy code authentication templates that are pre-defined by Meta.
| Channel | Template type | Language | Language tag/Verify locale | WhatsApp locale | Copy code text |
|---|---|---|---|---|---|
RCS | Custom | Abkhaz | ab | ||
SMS | Custom | Abkhaz | ab | ||
Voice | Custom | Abkhaz | ab | ||
RCS | Custom | Afar | aa | ||
SMS | Custom | Afar | aa | ||
Voice | Custom | Afar | aa | ||
RCS | Default | Afrikaans | af | ||
SMS | Default | Afrikaans | af | ||
RCS | Custom | Akan | ak | ||
SMS | Custom | Akan | ak | ||
Voice | Custom | Akan | ak | ||
RCS | Custom | Albanian | sq | ||
SMS | Custom | Albanian | sq | ||
Voice | Custom | Albanian | sq |
The following example sends an SMS OTP in Spanish by specifying the es locale in the request.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createVerification() {11const verification = await client.verify.v212.services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.verifications.create({14channel: "sms",15locale: "es",16to: "14155552345",17});1819console.log(verification.status);20}2122createVerification();
Response
1{2"sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"to": "14155552345",6"channel": "sms",7"status": "pending",8"valid": false,9"date_created": "2015-07-30T20:00:00Z",10"date_updated": "2015-07-30T20:00:00Z",11"lookup": {},12"amount": null,13"payee": null,14"send_code_attempts": [15{16"time": "2015-07-30T20:00:00Z",17"channel": "SMS",18"attempt_sid": "VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"19}20],21"sna": null,22"url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications/VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"23}