Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Services


A Verification Service is the set of common configurations used to create and check verifications. You can create a service with the API or in the Console(link takes you to an external page). Services include configuration for features like:

  • Email
  • Friendly Name (used in the Verification message templates, except in countries with brand restrictions(link takes you to an external page) )
  • Code Length
  • Skip sending SMS to Landlines
  • Requiring DTMF Input for Voice Verifications
  • Enabling Twilio Lookup

The SMS channel example below shows different friendly names and code lengths used in our SMS message templates.

sms example friendly name and code length.

Email Verification

email-verification page anchor

Follow along with the instructions here to set up your service to send email verifications.


Service Response Properties

service-response-properties page anchor

These fields are returned in the output JSON response. The type SID<VA> is a unique ID starting with the letters VA.

Resource properties
sidtype: SID<VA>Not PII

The unique string that we created to identify the Service resource.


account_sidtype: SID<AC>Not PII

The SID of the Account(link takes you to an external page) that created the Service resource.


friendly_nametype: stringNot PII

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


code_lengthtype: integerNot PII

The length of the verification code to generate.


lookup_enabledtype: booleanNot PII

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


psd2_enabledtype: booleanNot PII

Whether to pass PSD2 transaction parameters when starting a verification.


skip_sms_to_landlinestype: booleanNot PII

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


dtmf_input_requiredtype: booleanNot PII

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


tts_nametype: stringNot PII

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


do_not_share_warning_enabledtype: booleanNot PII

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


custom_code_enabledtype: booleanNot PII

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


pushtype: objectNot PII

Configurations for the Push factors (channel) created under this Service.


totptype: objectNot PII

Configurations for the TOTP factors (channel) created under this Service.


default_template_sidtype: SID<HJ>Not PII

verify_event_subscription_enabledtype: booleanNot PII

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


date_createdtype: string<DATE TIME>Not PII

The date and time in GMT when the resource was created specified in RFC 2822(link takes you to an external page) format.


date_updatedtype: string<DATE TIME>Not PII

The date and time in GMT when the resource was last updated specified in RFC 2822(link takes you to an external page) format.


urltype: string<URI>Not PII

The absolute URL of the resource.


linkstype: object<URI MAP>Not PII

The URLs of related resources.


Create a Verification Service

create-a-verification-service page anchor
POST https://verify.twilio.com/v2/Services

These are the available input parameters for creating a Service.

Parameters

create-parameters page anchor
Request body parameters
FriendlyNametype: stringNot PII
Required

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.


CodeLengthtype: integerNot PII

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


LookupEnabledtype: booleanNot PII

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


SkipSmsToLandlinestype: booleanNot PII

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


DtmfInputRequiredtype: booleanNot PII

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


TtsNametype: stringNot PII

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


Psd2Enabledtype: booleanNot PII

Whether to pass PSD2 transaction parameters when starting a verification.


DoNotShareWarningEnabledtype: booleanNot PII

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


CustomCodeEnabledtype: booleanNot PII

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


Push.IncludeDatetype: booleanNot PII

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(link takes you to an external page) 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.ApnCredentialSidtype: SID<CR>Not PII

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(link takes you to an external page)


Push.FcmCredentialSidtype: SID<CR>Not PII

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(link takes you to an external page)


Totp.Issuertype: stringNot PII

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.TimeSteptype: integerNot PII

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.CodeLengthtype: integerNot PII

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


Totp.Skewtype: integerNot PII

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


DefaultTemplateSidtype: SID<HJ>Not PII

The default message template(link takes you to an external page). Will be used for all SMS verifications unless explicitly overriden. SMS channel only.


VerifyEventSubscriptionEnabledtype: booleanNot PII

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

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.verify.v2.services
_10
.create({friendlyName: 'My Verify Service'})
_10
.then(service => console.log(service.sid));

Output

_38
{
_38
"sid": "VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"friendly_name": "My Verify Service",
_38
"code_length": 4,
_38
"lookup_enabled": false,
_38
"psd2_enabled": false,
_38
"skip_sms_to_landlines": false,
_38
"dtmf_input_required": false,
_38
"tts_name": "name",
_38
"do_not_share_warning_enabled": false,
_38
"custom_code_enabled": true,
_38
"push": {
_38
"include_date": false,
_38
"apn_credential_sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"fcm_credential_sid": null
_38
},
_38
"totp": {
_38
"issuer": "test-issuer",
_38
"time_step": 30,
_38
"code_length": 3,
_38
"skew": 2
_38
},
_38
"default_template_sid": "HJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"verify_event_subscription_enabled": false,
_38
"date_created": "2015-07-30T20:00:00Z",
_38
"date_updated": "2015-07-30T20:00:00Z",
_38
"url": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"links": {
_38
"verification_checks": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/VerificationCheck",
_38
"verifications": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Verifications",
_38
"rate_limits": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/RateLimits",
_38
"messaging_configurations": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/MessagingConfigurations",
_38
"entities": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities",
_38
"webhooks": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks",
_38
"access_tokens": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AccessTokens"
_38
}
_38
}


Associate a predefined template with a service

associate-a-predefined-template-with-a-service page anchor

A predefined template (public or private if there are any associated with your account) can be associated with a Verification Service by setting the DefaultTemplateSid attribute. By doing so, the message body of the verifications created with the service will use the text defined in the referenced template by default.

The default template SID<HJ> is a unique ID starting with the letters HJ. It is automatically generated when the template is created.

A complete list of the available templates for the account can be obtained by querying the Templates API.

The template that is going to be used in the verification will be selected in the following order:

  1. If a TemplateSid is received in the Create Verification request, the verification will use the text defined in the template identified with that Sid .
  2. If a DefaultTemplateSid is set for the Service, the verification will use the text defined in the template identified with that Sid .
  3. Otherwise, the text defined in the global default template will be used.

Create a Service with a default template

create-a-service-with-a-default-template page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_13
// Download the helper library from https://www.twilio.com/docs/node/install
_13
// Find your Account SID and Auth Token at twilio.com/console
_13
// and set the environment variables. See http://twil.io/secure
_13
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_13
const authToken = process.env.TWILIO_AUTH_TOKEN;
_13
const client = require('twilio')(accountSid, authToken);
_13
_13
client.verify.v2.services
_13
.create({
_13
defaultTemplateSid: 'HJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
_13
friendlyName: 'My Verify Service'
_13
})
_13
.then(service => console.log(service.sid));

Output

_38
{
_38
"sid": "VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"friendly_name": "My Verify Service",
_38
"code_length": 4,
_38
"lookup_enabled": false,
_38
"psd2_enabled": false,
_38
"skip_sms_to_landlines": false,
_38
"dtmf_input_required": false,
_38
"tts_name": "name",
_38
"do_not_share_warning_enabled": false,
_38
"custom_code_enabled": true,
_38
"push": {
_38
"include_date": false,
_38
"apn_credential_sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"fcm_credential_sid": null
_38
},
_38
"totp": {
_38
"issuer": "test-issuer",
_38
"time_step": 30,
_38
"code_length": 3,
_38
"skew": 2
_38
},
_38
"default_template_sid": "HJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"verify_event_subscription_enabled": false,
_38
"date_created": "2015-07-30T20:00:00Z",
_38
"date_updated": "2015-07-30T20:00:00Z",
_38
"url": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"links": {
_38
"verification_checks": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/VerificationCheck",
_38
"verifications": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Verifications",
_38
"rate_limits": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/RateLimits",
_38
"messaging_configurations": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/MessagingConfigurations",
_38
"entities": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities",
_38
"webhooks": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks",
_38
"access_tokens": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AccessTokens"
_38
}
_38
}

Create a PSD2 Enabled Service

create-a-psd2-enabled-service page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.verify.v2.services
_10
.create({psd2Enabled: true, friendlyName: 'Owl Banking'})
_10
.then(service => console.log(service.psd2Enabled));

Output

_38
{
_38
"sid": "VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"friendly_name": "Owl Banking",
_38
"code_length": 4,
_38
"lookup_enabled": false,
_38
"psd2_enabled": true,
_38
"skip_sms_to_landlines": false,
_38
"dtmf_input_required": false,
_38
"tts_name": "name",
_38
"do_not_share_warning_enabled": false,
_38
"custom_code_enabled": true,
_38
"push": {
_38
"include_date": false,
_38
"apn_credential_sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"fcm_credential_sid": null
_38
},
_38
"totp": {
_38
"issuer": "test-issuer",
_38
"time_step": 30,
_38
"code_length": 3,
_38
"skew": 2
_38
},
_38
"default_template_sid": "HJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"verify_event_subscription_enabled": false,
_38
"date_created": "2015-07-30T20:00:00Z",
_38
"date_updated": "2015-07-30T20:00:00Z",
_38
"url": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"links": {
_38
"verification_checks": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/VerificationCheck",
_38
"verifications": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Verifications",
_38
"rate_limits": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/RateLimits",
_38
"messaging_configurations": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/MessagingConfigurations",
_38
"entities": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities",
_38
"webhooks": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks",
_38
"access_tokens": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AccessTokens"
_38
}
_38
}

See Verifying Transactions for PSD2 for more information.


GET https://verify.twilio.com/v2/Services/{Sid}

URI parameters
Sidtype: SID<VA>Not PII
Path Parameter

The Twilio-provided string that uniquely identifies the Verification Service resource to fetch.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.fetch()
_10
.then(service => console.log(service.sid));

Output

_38
{
_38
"sid": "VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"friendly_name": "name",
_38
"code_length": 4,
_38
"lookup_enabled": false,
_38
"psd2_enabled": false,
_38
"skip_sms_to_landlines": false,
_38
"dtmf_input_required": false,
_38
"tts_name": "name",
_38
"do_not_share_warning_enabled": false,
_38
"custom_code_enabled": true,
_38
"push": {
_38
"include_date": false,
_38
"apn_credential_sid": null,
_38
"fcm_credential_sid": null
_38
},
_38
"totp": {
_38
"issuer": null,
_38
"time_step": null,
_38
"code_length": null,
_38
"skew": null
_38
},
_38
"default_template_sid": "HJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"verify_event_subscription_enabled": false,
_38
"date_created": "2015-07-30T20:00:00Z",
_38
"date_updated": "2015-07-30T20:00:00Z",
_38
"url": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"links": {
_38
"verification_checks": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/VerificationCheck",
_38
"verifications": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Verifications",
_38
"rate_limits": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/RateLimits",
_38
"messaging_configurations": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/MessagingConfigurations",
_38
"entities": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities",
_38
"webhooks": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks",
_38
"access_tokens": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AccessTokens"
_38
}
_38
}


GET https://verify.twilio.com/v2/Services

URI parameters
PageSizetype: integerNot PII
Query Parameter

How many resources to return in each list page. The default is 50, and the maximum is 1000.


Pagetype: integerNot PII
Query Parameter

The page index. This value is simply for client state.


PageTokentype: stringNot PII
Query Parameter

The page token. This is provided by the API.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.verify.v2.services
_10
.list({limit: 20})
_10
.then(services => services.forEach(s => console.log(s.sid)));

Output

_52
{
_52
"meta": {
_52
"page": 0,
_52
"page_size": 50,
_52
"first_page_url": "https://verify.twilio.com/v2/Services?PageSize=50&Page=0",
_52
"previous_page_url": "https://verify.twilio.com/v2/Services?PageSize=50&Page=0",
_52
"next_page_url": "https://verify.twilio.com/v2/Services?PageSize=50&Page=1",
_52
"key": "services",
_52
"url": "https://verify.twilio.com/v2/Services?PageSize=50&Page=0"
_52
},
_52
"services": [
_52
{
_52
"sid": "VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_52
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_52
"friendly_name": "name",
_52
"code_length": 4,
_52
"lookup_enabled": false,
_52
"psd2_enabled": false,
_52
"skip_sms_to_landlines": false,
_52
"dtmf_input_required": false,
_52
"tts_name": "name",
_52
"mailer_sid": "MDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_52
"do_not_share_warning_enabled": false,
_52
"custom_code_enabled": true,
_52
"push": {
_52
"include_date": false,
_52
"apn_credential_sid": null,
_52
"fcm_credential_sid": null
_52
},
_52
"totp": {
_52
"issuer": null,
_52
"time_step": null,
_52
"code_length": null,
_52
"skew": null
_52
},
_52
"default_template_sid": "HJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_52
"verify_event_subscription_enabled": false,
_52
"date_created": "2015-07-30T20:00:00Z",
_52
"date_updated": "2015-07-30T20:00:00Z",
_52
"url": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_52
"links": {
_52
"verification_checks": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/VerificationCheck",
_52
"verifications": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Verifications",
_52
"rate_limits": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/RateLimits",
_52
"messaging_configurations": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/MessagingConfigurations",
_52
"entities": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities",
_52
"webhooks": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks",
_52
"access_tokens": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AccessTokens"
_52
}
_52
}
_52
]
_52
}


POST https://verify.twilio.com/v2/Services/{Sid}

These are the available input parameters for updating a Service. The type SID<VA> is a unique ID starting with the letters VA.

URI parameters
Sidtype: SID<VA>Not PII
Path Parameter

The Twilio-provided string that uniquely identifies the Service resource to update.


Request body parameters
FriendlyNametype: stringNot PII

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.


CodeLengthtype: integerNot PII

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


LookupEnabledtype: booleanNot PII

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


SkipSmsToLandlinestype: booleanNot PII

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


DtmfInputRequiredtype: booleanNot PII

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


TtsNametype: stringNot PII

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


Psd2Enabledtype: booleanNot PII

Whether to pass PSD2 transaction parameters when starting a verification.


DoNotShareWarningEnabledtype: booleanNot PII

Whether to add a privacy warning at the end of an SMS. Disabled by default and applies only for SMS.


CustomCodeEnabledtype: booleanNot PII

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


Push.IncludeDatetype: booleanNot PII

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(link takes you to an external page) resource’s details parameter for more info. Default: false. Deprecated do not use this parameter.


Push.ApnCredentialSidtype: SID<CR>Not PII

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(link takes you to an external page)


Push.FcmCredentialSidtype: SID<CR>Not PII

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(link takes you to an external page)


Totp.Issuertype: stringNot PII

Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI.


Totp.TimeSteptype: integerNot PII

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.CodeLengthtype: integerNot PII

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


Totp.Skewtype: integerNot PII

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


DefaultTemplateSidtype: SID<HJ>Not PII

The default message template(link takes you to an external page). Will be used for all SMS verifications unless explicitly overriden. SMS channel only.


VerifyEventSubscriptionEnabledtype: booleanNot PII

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


Associate a template with an existing service

associate-a-template-with-an-existing-service page anchor

A predefined template can be associated with an already created Verification Service by setting the DefaultTemplateSid attribute. By doing so, the message body of the verifications created with the service will use by default the text defined in the template.
The default template SID<HJ> is a unique ID starting with the letters HJ. It is generated when the template is created.

A complete list of the available templates for the account can be obtained by querying the List Templates API.

The template that is going to be used in the verification will be defined following this order:

  1. If a TemplateSid is received in the Create Verification request, the verification will use the text defined in the template identified with that Sid .
  2. If a DefaultTemplateSid is set for the Service, the verification will use the text defined in the template identified with that Sid .
  3. Otherwise, the text defined in the default template will be used.

Update a Service default template.

update-a-service-default-template page anchor
curl

_10
curl -X POST https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
_10
--data-urlencode "DefaultTemplateSid=HJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" \
_10
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN

Output

_36
{
_36
"sid": "VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_36
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_36
"friendly_name": "name",
_36
"code_length": 7,
_36
"lookup_enabled": false,
_36
"psd2_enabled": false,
_36
"skip_sms_to_landlines": false,
_36
"dtmf_input_required": false,
_36
"tts_name": "name",
_36
"do_not_share_warning_enabled": false,
_36
"custom_code_enabled": true,
_36
"push": {
_36
"include_date": true,
_36
"apn_credential_sid": null,
_36
"fcm_credential_sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_36
},
_36
"totp": {
_36
"issuer": "test-issuer",
_36
"time_step": 30,
_36
"code_length": 3,
_36
"skew": 2
_36
},
_36
"date_created": "2015-07-30T20:00:00Z",
_36
"date_updated": "2015-07-30T20:00:00Z",
_36
"url": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_36
"links": {
_36
"verification_checks": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/VerificationCheck",
_36
"verifications": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Verifications",
_36
"rate_limits": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/RateLimits",
_36
"messaging_configurations": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/MessagingConfigurations",
_36
"entities": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities",
_36
"webhooks": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks",
_36
"access_tokens": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AccessTokens"
_36
}
_36
}

Update a Service's Code Length

update-a-services-code-length page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.update({codeLength: 7})
_10
.then(service => console.log(service.codeLength));

Output

_38
{
_38
"sid": "VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"friendly_name": "name",
_38
"code_length": 7,
_38
"lookup_enabled": false,
_38
"psd2_enabled": false,
_38
"skip_sms_to_landlines": false,
_38
"dtmf_input_required": false,
_38
"tts_name": "name",
_38
"do_not_share_warning_enabled": false,
_38
"custom_code_enabled": true,
_38
"push": {
_38
"include_date": false,
_38
"apn_credential_sid": null,
_38
"fcm_credential_sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_38
},
_38
"totp": {
_38
"issuer": "test-issuer",
_38
"time_step": 30,
_38
"code_length": 3,
_38
"skew": 2
_38
},
_38
"default_template_sid": "HJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"verify_event_subscription_enabled": false,
_38
"date_created": "2015-07-30T20:00:00Z",
_38
"date_updated": "2015-07-30T20:00:00Z",
_38
"url": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"links": {
_38
"verification_checks": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/VerificationCheck",
_38
"verifications": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Verifications",
_38
"rate_limits": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/RateLimits",
_38
"messaging_configurations": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/MessagingConfigurations",
_38
"entities": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities",
_38
"webhooks": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks",
_38
"access_tokens": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AccessTokens"
_38
}
_38
}

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.update({friendlyName: 'New and Improved Service Name'})
_10
.then(service => console.log(service.friendlyName));

Output

_38
{
_38
"sid": "VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"friendly_name": "New and Improved Service Name",
_38
"code_length": 4,
_38
"lookup_enabled": false,
_38
"psd2_enabled": false,
_38
"skip_sms_to_landlines": false,
_38
"dtmf_input_required": false,
_38
"tts_name": "name",
_38
"do_not_share_warning_enabled": false,
_38
"custom_code_enabled": true,
_38
"push": {
_38
"include_date": false,
_38
"apn_credential_sid": null,
_38
"fcm_credential_sid": "CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_38
},
_38
"totp": {
_38
"issuer": "test-issuer",
_38
"time_step": 30,
_38
"code_length": 3,
_38
"skew": 2
_38
},
_38
"default_template_sid": "HJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"verify_event_subscription_enabled": false,
_38
"date_created": "2015-07-30T20:00:00Z",
_38
"date_updated": "2015-07-30T20:00:00Z",
_38
"url": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_38
"links": {
_38
"verification_checks": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/VerificationCheck",
_38
"verifications": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Verifications",
_38
"rate_limits": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/RateLimits",
_38
"messaging_configurations": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/MessagingConfigurations",
_38
"entities": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Entities",
_38
"webhooks": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Webhooks",
_38
"access_tokens": "https://verify.twilio.com/v2/Services/VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/AccessTokens"
_38
}
_38
}


DELETE https://verify.twilio.com/v2/Services/{Sid}

URI parameters
Sidtype: SID<VA>Not PII
Path Parameter

The Twilio-provided string that uniquely identifies the Verification Service resource to delete.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove();


Rate this page: