Create a new Verification using a Service

POST /v2/Services/{ServiceSid}/Verifications

TODO: Resource-level docs

Create a new Verification using a Service

Path parameters

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 or call.

  • 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.

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

  • A custom user defined friendly name that overwrites the existing one in the verification message

  • 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, or zh-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.

  • 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.

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

  • The message template. If provided, will override the default template for the Service. SMS channel only.

    Minimum length is 34, maximum length is 34. 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.

Responses

  • Created

    Hide response attributes Show response attributes object
    • account_sid string | null

      The SID of the Account that created the resource

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

    • amount string | null

      The amount of the associated PSD2 compliant transaction.

    • channel string | null

      The verification method used.

      Values are sms, call, email, whatsapp, or silent.

    • date_created string(date-time) | null

      The RFC 2822 date and time in GMT when the resource was created

    • date_updated string(date-time) | null

      The RFC 2822 date and time in GMT when the resource was last updated

    • Information about the phone number being verified

    • payee string | null

      The payee of the associated PSD2 compliant transaction

    • An array of verification attempt objects.

    • service_sid string | null

      The SID of the Service that the resource is associated with

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^VA[0-9a-fA-F]{32}$.

    • sid string | null

      The unique string that identifies the resource

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^VE[0-9a-fA-F]{32}$.

    • status string | null

      The status of the verification resource

    • to string | null

      The phone number or email being verified

    • url string(uri) | null

      The absolute URL of the Verification resource

    • valid boolean | null

      Whether the verification was successful

POST /v2/Services/{ServiceSid}/Verifications
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'
Request example
{
  "Amount": "string",
  "AppHash": "string",
  "Channel": "string",
  "CustomCode": "string",
  "CustomFriendlyName": "string",
  "CustomMessage": "string",
  "Locale": "string",
  "Payee": "string",
  "SendDigits": "string",
  "TemplateCustomSubstitutions": "string",
  "TemplateSid": "string",
  "To": "string"
}
Request examples
{
  "Amount": "string",
  "AppHash": "string",
  "Channel": "string",
  "CustomCode": "string",
  "CustomFriendlyName": "string",
  "CustomMessage": "string",
  "Locale": "string",
  "Payee": "string",
  "SendDigits": "string",
  "TemplateCustomSubstitutions": "string",
  "TemplateSid": "string",
  "To": "string"
}
Response examples (201)
{
  "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
}
Response examples (201)
{
  "account_sid": "string",
  "amount": "string",
  "channel": "sms",
  "date_created": "2024-05-04T09:42:00+00:00",
  "date_updated": "2024-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
}