Create a new Verification Service

POST /v2/Services

TODO: Resource-level docs

Create a new Verification Service.

application/x-www-form-urlencoded

Body

  • CodeLength integer

    The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive.

  • Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers.

  • The default message template. Will be used for all SMS verifications unless explicitly overriden. SMS channel only.

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

  • Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code

  • Whether to ask the user to press a number before delivering the verify code in a phone call.

  • FriendlyName string Required

    A descriptive string that you create to describe the verification service. It can be up to 30 characters long. This value should not contain PII.

  • Whether to perform a lookup with each verification started and return info about the phone number.

  • Whether to pass PSD2 transaction parameters when starting a verification.

  • Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See Credential Resource

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

  • Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See Credential Resource

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

  • Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See Challenge resource’s details parameter for more info. Default: false. Deprecated do not use this parameter. This timestamp value is the same one as the one found in date_created, please use that one instead.

  • Whether to skip sending SMS verifications to landlines. Requires lookup_enabled.

  • Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6

  • Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. Defaults to the service friendly name if not provided.

  • Totp.Skew integer

    Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1

  • Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds

  • TtsName string

    The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages.

Responses

  • 201

    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}$.

    • code_length integer | null

      The length of the verification code

    • custom_code_enabled boolean | null

      Whether to allow sending verifications with a custom code.

    • 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

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

    • Whether to add a security warning at the end of an SMS.

    • dtmf_input_required boolean | null

      Whether to ask the user to press a number before delivering the verify code in a phone call

    • friendly_name string | null

      The string that you assigned to describe the verification service

    • lookup_enabled boolean | null

      Whether to perform a lookup with each verification

    • psd2_enabled boolean | null

      Whether to pass PSD2 transaction parameters when starting a verification

    • The service level configuration of factor push type.

    • sid string | null

      The unique string that identifies the resource

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

    • Whether to skip sending SMS verifications to landlines

    • The service level configuration of factor TOTP type.

    • tts_name string | null

      The name of an alternative text-to-speech service to use in phone calls

    • url string(uri) | null

      The absolute URL of the resource

POST /v2/Services
curl \
 -X POST https://verify.twilio.com/v2/Services \
 --user "username:password" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -d 'CodeLength=42&CustomCodeEnabled=true&DefaultTemplateSid=string&DoNotShareWarningEnabled=true&DtmfInputRequired=true&FriendlyName=string&LookupEnabled=true&Psd2Enabled=true&Push.ApnCredentialSid=string&Push.FcmCredentialSid=string&Push.IncludeDate=true&SkipSmsToLandlines=true&Totp.CodeLength=42&Totp.Issuer=string&Totp.Skew=42&Totp.TimeStep=42&TtsName=string'
Request example
{
  "CodeLength": 42,
  "CustomCodeEnabled": true,
  "DefaultTemplateSid": "string",
  "DoNotShareWarningEnabled": true,
  "DtmfInputRequired": true,
  "FriendlyName": "string",
  "LookupEnabled": true,
  "Psd2Enabled": true,
  "Push.ApnCredentialSid": "string",
  "Push.FcmCredentialSid": "string",
  "Push.IncludeDate": true,
  "SkipSmsToLandlines": true,
  "Totp.CodeLength": 42,
  "Totp.Issuer": "string",
  "Totp.Skew": 42,
  "Totp.TimeStep": 42,
  "TtsName": "string"
}
Response examples (201)
{
  "account_sid": "string",
  "code_length": 42,
  "custom_code_enabled": true,
  "date_created": "2023-05-04T09:42:00+00:00",
  "date_updated": "2023-05-04T09:42:00+00:00",
  "default_template_sid": "string",
  "do_not_share_warning_enabled": true,
  "dtmf_input_required": true,
  "friendly_name": "string",
  "links": {},
  "lookup_enabled": true,
  "psd2_enabled": true,
  "sid": "string",
  "skip_sms_to_landlines": true,
  "tts_name": "string",
  "url": "https://example.com"
}