Create a new Verification using a Service
TODO: Resource-level docs
Create a new Verification using a Service
Path parameters
-
ServiceSid
string Required The SID of the verification Service to create the resource under.
Body
-
Amount
string The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.
-
AppHash
string Your App Hash to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body:
<#> Your AppName verification code is: 1234 He42w354ol9
. -
Channel
string Required The verification method to use. Can be:
email
,sms
,whatsapp
orcall
. -
email
channel configuration in json format. The fields 'from' and 'from_name' are optional but if included the 'from' field must have a valid email address. -
CustomCode
string A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive.
-
CustomFriendlyName
string A custom user defined friendly name that overwrites the existing one in the verification message
-
CustomMessage
string The text of a custom message to use for the verification.
-
Locale
string The locale to use for the verification SMS, WhatsApp or call. Can be:
af
,ar
,ca
,cs
,da
,de
,el
,en
,en-GB
,es
,fi
,fr
,he
,hi
,hr
,hu
,id
,it
,ja
,ko
,ms
,nb
,nl
,pl
,pt
,pr-BR
,ro
,ru
,sv
,th
,tl
,tr
,vi
,zh
,zh-CN
, orzh-HK.
-
Payee
string The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.
-
The custom key-value pairs of Programmable Rate Limits. Keys correspond to
unique_name
fields defined when creating your Rate Limit. Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request. -
SendDigits
string The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of sendDigits.
-
TemplateCustomSubstitutions
string A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions.
-
TemplateSid
string The message template. If provided, will override the default template for the Service. SMS channel only.
Minimum length is
34
, maximum length is34
. Format should match the following pattern:^HJ[0-9a-fA-F]{32}$
. -
To
string Required The phone number or email to verify. Phone numbers must be in E.164 format.
curl \
-X POST https://verify.twilio.com/v2/Services/{ServiceSid}/Verifications \
--user "username:password" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d 'Amount=string&AppHash=string&Channel=string&CustomCode=string&CustomFriendlyName=string&CustomMessage=string&Locale=string&Payee=string&SendDigits=string&TemplateCustomSubstitutions=string&TemplateSid=string&To=string'
{
"Amount": "string",
"AppHash": "string",
"Channel": "string",
"CustomCode": "string",
"CustomFriendlyName": "string",
"CustomMessage": "string",
"Locale": "string",
"Payee": "string",
"SendDigits": "string",
"TemplateCustomSubstitutions": "string",
"TemplateSid": "string",
"To": "string"
}
{
"Amount": "string",
"AppHash": "string",
"Channel": "string",
"CustomCode": "string",
"CustomFriendlyName": "string",
"CustomMessage": "string",
"Locale": "string",
"Payee": "string",
"SendDigits": "string",
"TemplateCustomSubstitutions": "string",
"TemplateSid": "string",
"To": "string"
}
{
"account_sid": "string",
"amount": "string",
"channel": "sms",
"date_created": "2023-05-04T09:42:00+00:00",
"date_updated": "2023-05-04T09:42:00+00:00",
"payee": "string",
"send_code_attempts": [],
"service_sid": "string",
"sid": "string",
"status": "string",
"to": "string",
"url": "https://example.com",
"valid": true
}
{
"account_sid": "string",
"amount": "string",
"channel": "sms",
"date_created": "2025-05-04T09:42:00Z",
"date_updated": "2025-05-04T09:42:00Z",
"payee": "string",
"send_code_attempts": [],
"service_sid": "string",
"sid": "string",
"status": "string",
"to": "string",
"url": "https://example.com",
"valid": true
}