Skip to contentSkip to navigationSkip to topbar
Page toolsOn this pageProducts used
Looking for more inspiration?Visit the
Error
Application error

60224: Missing substitutions for selected template

Twilio Verify DocumentationVerify

Description

description page anchor

The selected template has one or more expected substitutions that were not provided in the request.

Possible causes

possible-causes page anchor
  • The template requires extra fields for building the message that are not included in the request.
  • The substitutions were not provided in the correct format (stringified JSON).
  • Include all the substitutions for the place holder variables with the TemplateCustomSubstitution parameter.
  • Format the variable object as stringified JSON.

For example, the following template requires a uuid substitution:

"Your {{friendly_name}} login link: https://example.com/verify.html?uuid={{uuid}}&code={{code}}"

The expected request in cURL:

1
curl -X POST https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Verifications \
2
--data-urlencode "To=+15017122661" \
3
--data-urlencode "Channel=sms" \
4
--data-urlencode "TemplateSid=HJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
5
--data-urlencode "TemplateCustomSubstitutions={ \"uuid\": \"MY_UNIQUE_ID\" }" \
6
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN

The expected request in Node.js:

1
const verification = await client.verify.v2
2
.services("VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
3
.verifications.create({
4
channel: "sms",
5
templateSid: "HJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
6
to: "+15017122661",
7
templateCustomSubstitutions: '{ "uuid": "MY_UNIQUE_ID" }'
8
});

The following variables are auto-populated by Twilio and do not need to be included in your request:

  • {{friendly_name}}
  • {{code}}
  • {{ttl}}