VerifyVerifications

Create Verification

POST
/v2/Services/{ServiceSid}/Verifications

Create a new Verification using a Service

Authorization

accountSid_authToken
AuthorizationBasic <token>

In: header

Path Parameters

ServiceSid*string

The SID of the verification Service to create the resource under.

Match^VA[0-9a-fA-F]{32}$
Length34 <= length <= 34

Request Body

application/x-www-form-urlencoded

To*string

The phone number or email to verify. Phone numbers must be in E.164 format.

Channel*string

The verification method to use. One of: email, sms, whatsapp, call, sna or auto.

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.

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.

Locale?string

Locale will automatically resolve based on phone number country code for SMS, WhatsApp, and call channel verifications. It will fallback to English or the template’s default translation if the selected translation is not available. This parameter will override the automatic locale resolution. See supported languages and more information here.

CustomCode?string

A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive.

Amount?string

The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.

Payee?string

The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled.

RateLimits?unknown

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.

ChannelConfiguration?unknown

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.

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.

TemplateSid?string

The message template. If provided, will override the default template for the Service. SMS and Voice channels only.

Match^HJ[0-9a-fA-F]{32}$
Length34 <= length <= 34
TemplateCustomSubstitutions?string

A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions.

DeviceIp?string

Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address.

EnableSnaClientToken?boolean

An optional Boolean value to indicate the requirement of sna client token in the SNA URL invocation response for added security. This token must match in the Verification Check request to confirm phone number verification.

RiskCheck?VerificationEnumRiskCheck

Risk_check overrides Fraud Prevention measures like Fraud Guard, Geo Permissions etc per verification attempt basis, allowing Verify to block traffic considered fraudulent if enabled or bypass active protections if disabled. Can be: enable(default) or disable. For SMS channel only.

Value in

  • "enable"
  • "disable"
Tags?string

A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length.

Response Body

application/json

application/json

curl -X POST "https://example.com/v2/Services/stringstringstringstringstringstri/Verifications" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'To=%2B15017122661&Channel=sms&CustomCode=custom_code&CustomFriendlyName=custom_friendly_name&CustomMessage=custom_message&SendDigits=ww1&Locale=en&Amount=%E2%82%AC39.99&Payee=Acme+Inc.&AppHash=AAAAAAAAAAA&TemplateSid=HJaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&TemplateCustomSubstitutions=%7B%22AppName%22%3A+%22MyApp%22%2C+%22Contact%22%3A%2212345689%22%7D&RiskCheck=enable&Tags=%7B%22tenant_id%22%3A+%2212345%22%7D'

{  "sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "to": "+15017122661",  "channel": "sms",  "status": "pending",  "valid": false,  "date_created": "2015-07-30T20:00:00Z",  "date_updated": "2015-07-30T20:00:00Z",  "lookup": {},  "amount": null,  "payee": null,  "send_code_attempts": [    {      "time": "2015-07-30T20:00:00Z",      "channel": "SMS",      "attempt_sid": "VLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"    }  ],  "sna": null,  "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications/VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}