Templates
Verify Templates are in Public Beta! Pre-approved and custom templates are currently in the Public Beta maturity stage, which means that:
We're actively looking for early-adopter customers to try it out and give us feedback. That could be you!
Please note that pre-approved and custom templates are only supported with the SMS and Voice channels.
Templates are predefined and approved messages used to send Verifications that allow you to customize the Verification message. An account can have multiple templates associated with it to accommodate various scenarios.
Verify offers three different types of templates to support your use cases: Verify Default, pre-approved, and custom. Read more about the features and differences of these template types here .
Verify will automatically resolve a template message body's locale based on phone number country code or fallback to English or a custom template's default language. Using this automatic resolution is highly recommended. If you still must override locale, use the locale
parameter. Learn more about supported languages here .
Property name Type PII Description
A 34 character string that uniquely identifies a Verification Template.
Pattern: ^HJ[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The unique SID identifier of the Account.
Pattern: ^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
A descriptive string that you create to describe a Template. It can be up to 32 characters long.
A list of channels that support the Template. Can include: sms, voice.
An object that contains the different translations of the template. Every translation is identified by the language short name and contains its respective information as the approval status, text and created/modified date.
GET https://verify.twilio.com/v2/Templates
Property name Type Required PII Description
FriendlyName string Optional String filter used to query templates with a given friendly name.
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Minimum: 1
Maximum: 1000
The page index. This value is simply for client state.
Minimum: 0
The page token. This is provided by the API.
Returns pre-approved and custom templates for your account
_10 // Download the helper library from https://www.twilio.com/docs/node/install
_10 // Find your Account SID and Auth Token at twilio.com/console
_10 // and set the environment variables. See http://twil.io/secure
_10 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10 const authToken = process.env.TWILIO_AUTH_TOKEN;
_10 const client = require('twilio')(accountSid, authToken);
_10 client.verify.v2.templates
_10 .then(templates => templates.forEach(t => console.log(t.translations)));
_50 "sid": "HJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_50 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_50 "friendly_name": "Base Verification Template 2 with do not share",
_50 "is_default_translation": true,
_50 "status": "approved",
_50 "text": "Your {{friendly_name}} verification code is: {{code}}. Do not share this code with anyone.",
_50 "date_updated": "2021-07-29T20:38:28.759979905Z",
_50 "date_created": "2021-07-29T20:38:28.165602325Z"
_50 "sid": "HJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_50 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_50 "friendly_name": "Base Verification Template 3",
_50 "is_default_translation": true,
_50 "status": "approved",
_50 "text": "Your verification code is: {{code}}. Do not share it.",
_50 "date_updated": "2021-07-29T20:38:28.759979905Z",
_50 "date_created": "2021-07-29T20:38:28.165602325Z"
_50 "first_page_url": "https://verify.twilio.com/v2/Templates?PageSize=50&Page=0",
_50 "previous_page_url": "https://verify.twilio.com/v2/Templates?PageSize=50&Page=0",
_50 "url": "https://verify.twilio.com/v2/Templates?PageSize=50&Page=0",
_50 "next_page_url": "https://verify.twilio.com/v2/Templates?PageSize=50&Page=1",
Tip If you have jq
(link takes you to an external page) installed you can quickly see all of the English language templates with the following command:
_10 curl -X GET "https://verify.twilio.com/v2/Templates" \
_10 -u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN \
_10 | jq '.templates[] | {sid: .sid, template: .translations.en.text}'
To set a default template for a new Service, set the default_template_sid
parameter:
_13 // Download the helper library from https://www.twilio.com/docs/node/install
_13 // Find your Account SID and Auth Token at twilio.com/console
_13 // and set the environment variables. See http://twil.io/secure
_13 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_13 const authToken = process.env.TWILIO_AUTH_TOKEN;
_13 const client = require('twilio')(accountSid, authToken);
_13 client.verify.v2.services
_13 defaultTemplateSid: 'HJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
_13 friendlyName: 'My Verify Service'
_13 .then(service => console.log(service.sid));
_42 "sid": "VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_42 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_42 "friendly_name": "My Verify Service",
_42 "lookup_enabled": false,
_42 "psd2_enabled": false,
_42 "skip_sms_to_landlines": false,
_42 "dtmf_input_required": false,
_42 "do_not_share_warning_enabled": false,
_42 "custom_code_enabled": true,
_42 "include_date": false,
_42 "apn_credential_sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_42 "fcm_credential_sid": null
_42 "issuer": "test-issuer",
_42 "msg_service_sid": "MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_42 "from": "whatsapp:+1234567890"
_42 "default_template_sid": "HJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_42 "verify_event_subscription_enabled": false,
_42 "date_created": "2015-07-30T20:00:00Z",
_42 "date_updated": "2015-07-30T20:00:00Z",
_42 "url": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_42 "verification_checks": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/VerificationCheck",
_42 "verifications": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Verifications",
_42 "rate_limits": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/RateLimits",
_42 "messaging_configurations": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/MessagingConfigurations",
_42 "entities": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities",
_42 "webhooks": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks",
_42 "access_tokens": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AccessTokens"
To send a verification with a specified template, include the TemplateSid (starts with HJ) as a parameter.
_15 // Download the helper library from https://www.twilio.com/docs/node/install
_15 // Find your Account SID and Auth Token at twilio.com/console
_15 // and set the environment variables. See http://twil.io/secure
_15 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_15 const authToken = process.env.TWILIO_AUTH_TOKEN;
_15 const client = require('twilio')(accountSid, authToken);
_15 client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_15 templateSid: 'HJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
_15 .then(verification => console.log(verification.status));
_23 "sid": "VEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_23 "service_sid": "VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_23 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_23 "to": "+15017122661",
_23 "date_created": "2015-07-30T20:00:00Z",
_23 "date_updated": "2015-07-30T20:00:00Z",
_23 "send_code_attempts": [
_23 "time": "2015-07-30T20:00:00Z",
_23 "attempt_sid": "VLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_23 "url": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Verifications/VEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"