VerifyServices

Create Service

POST
/v2/Services

Create a new Verification Service.

Authorization

accountSid_authToken
AuthorizationBasic <token>

In: header

Request Body

application/x-www-form-urlencoded

FriendlyName*string

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

CodeLength?integer

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

LookupEnabled?boolean

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

SkipSmsToLandlines?boolean

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

DtmfInputRequired?boolean

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

TtsName?string

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

Psd2Enabled?boolean

Whether to pass PSD2 transaction parameters when starting a verification.

DoNotShareWarningEnabled?boolean

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

CustomCodeEnabled?boolean

Whether to allow sending verifications with a custom code instead of a randomly generated one.

Push.IncludeDate?boolean

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.

Push.ApnCredentialSid?string

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

Match^CR[0-9a-fA-F]{32}$
Length34 <= length <= 34
Push.FcmCredentialSid?string

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

Match^CR[0-9a-fA-F]{32}$
Length34 <= length <= 34
Totp.Issuer?string

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.TimeStep?integer

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

Totp.CodeLength?integer

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

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

DefaultTemplateSid?string

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

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

The SID of the Messaging Service containing WhatsApp Sender(s) that Verify will use to send WhatsApp messages to your users.

Match^MG[0-9a-fA-F]{32}$
Length34 <= length <= 34
Whatsapp.From?string

The number to use as the WhatsApp Sender that Verify will use to send WhatsApp messages to your users.This WhatsApp Sender must be associated with a Messaging Service SID.

Passkeys.RelyingParty.Id?string

The Relying Party ID for Passkeys. This is the domain of your application, e.g. example.com. It is used to identify your application when creating Passkeys.

Passkeys.RelyingParty.Name?string

The Relying Party Name for Passkeys. This is the name of your application, e.g. Example App. It is used to identify your application when creating Passkeys.

Passkeys.RelyingParty.Origins?string

The Relying Party Origins for Passkeys. This is the origin of your application, e.g. login.example.com,www.example.com. It is used to identify your application when creating Passkeys, it can have multiple origins split by ,.

Passkeys.AuthenticatorAttachment?string

The Authenticator Attachment for Passkeys. This is the type of authenticator that will be used to create Passkeys. It can be empty or it can have the values platform, cross-platform or any.

Passkeys.DiscoverableCredentials?string

Indicates whether credentials must be discoverable by the authenticator. It can be empty or it can have the values required, preferred or discouraged.

Passkeys.UserVerification?string

The User Verification for Passkeys. This is the type of user verification that will be used to create Passkeys. It can be empty or it can have the values required, preferred or discouraged.

VerifyEventSubscriptionEnabled?boolean

Whether to allow verifications from the service to reach the stream-events sinks if configured

Response Body

application/json

curl -X POST "https://example.com/v2/Services" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'FriendlyName=name&CodeLength=4&TtsName=name&MailerSid=MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&CustomCodeEnabled=true&Push.ApnCredentialSid=CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Totp.Issuer=test-issuer&Totp.TimeStep=30&Totp.CodeLength=3&Totp.Skew=2&DefaultTemplateSid=HJaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
{  "sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "friendly_name": "name",  "code_length": 4,  "lookup_enabled": false,  "psd2_enabled": false,  "skip_sms_to_landlines": false,  "dtmf_input_required": false,  "tts_name": "name",  "do_not_share_warning_enabled": false,  "custom_code_enabled": true,  "push": {    "include_date": false,    "apn_credential_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",    "fcm_credential_sid": null  },  "totp": {    "issuer": "test-issuer",    "time_step": 30,    "code_length": 3,    "skew": 2  },  "whatsapp": {    "msg_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",    "from": "whatsapp:+1234567890"  },  "passkeys": {    "relying_party": {      "id": "www.mydomain.com",      "name": "My domain",      "origins": [        "www.mydomain.com",        "www.login.mydomain.com"      ]    },    "authenticator_attachment": "",    "discoverable_credentials": null,    "user_verification": "discouraged"  },  "default_template_sid": "HJaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "verify_event_subscription_enabled": false,  "date_created": "2015-07-30T20:00:00Z",  "date_updated": "2015-07-30T20:00:00Z",  "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",  "links": {    "verification_checks": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/VerificationCheck",    "verifications": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications",    "rate_limits": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RateLimits",    "messaging_configurations": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessagingConfigurations",    "entities": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities",    "webhooks": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks",    "access_tokens": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AccessTokens"  }}