Skip to content

Vonage Verify v2

github-actions edited this page Jan 8, 2025 · 80 revisions

Vonage Verify v2


Documentation / Vonage Verify v2

Vonage Verify v2

Enumerations

Channels

Defined in: verify2/lib/enums/channels.ts:4

Enum representing different communication channels for verification.

Enumeration Members

Enumeration Member Value Description Defined in
EMAIL "email" Email channel for verification. verify2/lib/enums/channels.ts:28
SMS "sms" SMS channel for verification. verify2/lib/enums/channels.ts:8
VOICE "voice" Voice channel for verification. verify2/lib/enums/channels.ts:23
WHATSAPP "whatsapp" WhatsApp channel for verification. verify2/lib/enums/channels.ts:13
WHATSAPP_INTERACTIVE "whatsapp_interactive" Interactive WhatsApp channel for verification. verify2/lib/enums/channels.ts:18

EventStatus

Defined in: verify2/lib/enums/eventStatus.ts:4

Enum representing the status of an event in the verification process.

Enumeration Members

Enumeration Member Value Description Defined in
COMPLETED "completed" The event has been completed successfully. verify2/lib/enums/eventStatus.ts:8
FAILED "failed" The event has failed. verify2/lib/enums/eventStatus.ts:13
REJECTED "rejected" The event has been rejected. verify2/lib/enums/eventStatus.ts:23
USER_REJECTED "user_rejected" The user has rejected the event. verify2/lib/enums/eventStatus.ts:18

RequestStatus

Defined in: verify2/lib/enums/requestStatus.ts:4

Enum representing the status of a verification request.

Enumeration Members

Enumeration Member Value Description Defined in
COMPLETED "completed" The verification request has been completed successfully. verify2/lib/enums/requestStatus.ts:8
EXPIRED "expired" The verification request has expired. verify2/lib/enums/requestStatus.ts:18
FAILED "failed" The verification request has failed. verify2/lib/enums/requestStatus.ts:13

RequestWorkflowStatus

Defined in: verify2/lib/enums/requestWorkflowsStatus.ts:4

Enum representing the status of a verification request workflow step.

Enumeration Members

Enumeration Member Value Description Defined in
COMPLETED "completed" The workflow step has been completed successfully. verify2/lib/enums/requestWorkflowsStatus.ts:13
EXPIRED "expired" The workflow step has expired. verify2/lib/enums/requestWorkflowsStatus.ts:23
FAILED "failed" The workflow step has failed. verify2/lib/enums/requestWorkflowsStatus.ts:18
UNUSED "unused" The workflow step is unused. verify2/lib/enums/requestWorkflowsStatus.ts:8
USER_REJECTED "user_rejected" The user has rejected the workflow step. verify2/lib/enums/requestWorkflowsStatus.ts:28

SilenAuthStatus

Defined in: verify2/lib/enums/silentAuthStatus.ts:4

Enum representing the status of Silent Authentication.

Enumeration Members

Enumeration Member Value Description Defined in
ACTION_PENDING "action_pending" An action is pending for Silent Authentication. verify2/lib/enums/silentAuthStatus.ts:28
COMPLETED "completed" Silent Authentication has been completed successfully. verify2/lib/enums/silentAuthStatus.ts:8
EXPIRED "expired" Silent Authentication has expired. verify2/lib/enums/silentAuthStatus.ts:23
FAILED "failed" Silent Authentication has failed. verify2/lib/enums/silentAuthStatus.ts:13
USER_REJECTED "user_rejected" The user has rejected Silent Authentication. verify2/lib/enums/silentAuthStatus.ts:18

SilentAuthChannel

Defined in: verify2/lib/enums/channels.ts:34

Enum representing the Silent Authentication channel.

Enumeration Members

Enumeration Member Value Description Defined in
SILENT_AUTH "silent_auth" Silent Authentication channel for verification. verify2/lib/enums/channels.ts:38

VerifyLocale

Defined in: verify2/lib/enums/verifyLocale.ts:4

Enum representing different locales for verification.

Enumeration Members

Enumeration Member Value Description Defined in
DE_DE "de-de" German (Germany) locale. verify2/lib/enums/verifyLocale.ts:43
EN_GB "en-gb" English (United Kingdom) locale. verify2/lib/enums/verifyLocale.ts:13
EN_US "en-us" English (United States) locale. verify2/lib/enums/verifyLocale.ts:8
ES_ES "es-es" Spanish (Spain) locale. verify2/lib/enums/verifyLocale.ts:18
ES_MX "es-mx" Spanish (Mexico) locale. verify2/lib/enums/verifyLocale.ts:23
ES_US "es-us" Spanish (United States) locale. verify2/lib/enums/verifyLocale.ts:28
FR_FR "fr-fr" French (France) locale. verify2/lib/enums/verifyLocale.ts:38
HI_IN "hi-in" Hindi (India) locale. verify2/lib/enums/verifyLocale.ts:53
ID_ID "id-id" Indonesian (Indonesia) locale. verify2/lib/enums/verifyLocale.ts:68
IT_IT "it-it" Italian (Italy) locale. verify2/lib/enums/verifyLocale.ts:33
PT_BR "pt-br" Portuguese (Brazil) locale. verify2/lib/enums/verifyLocale.ts:58
PT_PT "pt-pt" Portuguese (Portugal) locale. verify2/lib/enums/verifyLocale.ts:63
RU_RU "ru-ru" Russian (Russia) locale. verify2/lib/enums/verifyLocale.ts:48

Classes

Verify2

Defined in: verify2/lib/verify2.ts:22

A class for interacting with the Vonage Verify API (Version 2).

Extends

Constructors

new Verify2()
new Verify2(credentials, options?): Verify2

Defined in: server-client/dist/lib/client.d.ts:35

Creates a new instance of the Client.

Parameters
credentials

The authentication credentials or an authentication instance.

AuthInterface | AuthParams

options?

ConfigParams

Optional configuration settings for the client.

Returns

Verify2

Inherited from

Client.constructor

Properties

auth
protected auth: AuthInterface;

Defined in: server-client/dist/lib/client.d.ts:24

The authentication instance responsible for generating authentication headers and query parameters.

Inherited from

Client.auth

authType
protected authType: AuthenticationType = AuthenticationType.JWT;

Defined in: verify2/lib/verify2.ts:26

The authentication type used for this client (JWT).

Overrides

Client.authType

config
protected config: ConfigParams;

Defined in: server-client/dist/lib/client.d.ts:28

Configuration settings for the client, including default hosts for various services and other request settings.

Inherited from

Client.config

transformers
static transformers: object;

Defined in: server-client/dist/lib/client.d.ts:11

Static property containing utility transformers.

camelCaseObjectKeys
camelCaseObjectKeys: PartialTransformFunction;
kebabCaseObjectKeys
kebabCaseObjectKeys: PartialTransformFunction;
omit()
omit: (keys, obj) => TransformedObject;
Parameters
keys

string[]

obj

ObjectToTransform

Returns

TransformedObject

snakeCaseObjectKeys
snakeCaseObjectKeys: PartialTransformFunction;
Inherited from

Client.transformers

Methods

addAuthenticationToRequest()
addAuthenticationToRequest(request): Promise<VetchOptions>

Defined in: server-client/dist/lib/client.d.ts:43

Adds the appropriate authentication headers or parameters to the request based on the authentication type.

Parameters
request

VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addAuthenticationToRequest

addBasicAuthToRequest()
protected addBasicAuthToRequest(request): Promise<VetchOptions>

Defined in: server-client/dist/lib/client.d.ts:71

Adds basic authentication headers to the request.

Parameters
request

VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addBasicAuthToRequest

addJWTToRequest()
protected addJWTToRequest(request): Promise<VetchOptions>

Defined in: server-client/dist/lib/client.d.ts:64

Adds a JWT to the request.

Parameters
request

VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addJWTToRequest

addQueryKeySecretToRequest()
protected addQueryKeySecretToRequest(request): Promise<VetchOptions>

Defined in: server-client/dist/lib/client.d.ts:57

Adds API key and secret to the request.

Parameters
request

VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addQueryKeySecretToRequest

addQueryKeySecretToRequestBody()
protected addQueryKeySecretToRequestBody(request): Promise<VetchOptions>

Defined in: server-client/dist/lib/client.d.ts:50

Adds API key and secret to the request body.

Parameters
request

VetchOptions

The request options to which authentication needs to be added.

Returns

Promise<VetchOptions>

  • The request options with the added authentication.
Inherited from

Client.addQueryKeySecretToRequestBody

cancel()
cancel(requestId): Promise<boolean>

Defined in: verify2/lib/verify2.ts:69

Cancels a verification request.

Parameters
requestId

string

The ID of the verification request to cancel.

Returns

Promise<boolean>

true if the cancellation was successful.

checkCode()
checkCode(requestId, code): Promise<string>

Defined in: verify2/lib/verify2.ts:53

Checks a verification code against a verification request.

Parameters
requestId

string

The ID of the verification request.

code

string

The verification code to check.

Returns

Promise<string>

The status of the verification code check.

createTemplate()
createTemplate(template): Promise<Template>

Defined in: verify2/lib/verify2.ts:182

Creates a new template with the provided details.

Parameters
template

Template

The template details to be created.

Returns

Promise<Template>

  • A promise resolving to the created template in camelCase format.
Example

Create a new template:

const newTemplate = await templateClient.createTemplate({
  name: 'My New Template',
});
console.log(newTemplate.name);
createTemplateFragment()
createTemplateFragment(templateId, fragment): Promise<TemplateFragment>

Defined in: verify2/lib/verify2.ts:397

Creates a new template fragment with the provided details.

Parameters
templateId

string

The unique identifier of the template to which the fragment belongs.

fragment

TemplateFragment

The details of the template fragment to be created.

Returns

Promise<TemplateFragment>

  • A promise resolving to the created template fragment in camelCase format.
Example

Create a new template fragment:

const newFragment = await templateClient.createTemplateFragment(
  '22f571c1-f41a-4db2-bba7-f23a069200c1',
  {
    channel: 'sms',
    locale: 'en-us',
    text: 'Your verification code is ${code}',
  },
);
console.log(newFragment.text);
deleteTemplate()
deleteTemplate(templateId): Promise<true>

Defined in: verify2/lib/verify2.ts:227

Deletes a template by its unique identifier.

Parameters
templateId

string

The unique identifier of the template to delete.

Returns

Promise<true>

  • A promise that resolves when the template is successfully deleted.
Example

Delete a template by ID:

await templateClient.deleteTemplate('22f571c1-f41a-4db2-bba7-f23a069200c1');
console.log('Template deleted successfully');
deleteTemplateFragment()
deleteTemplateFragment(templateId, fragmentId): Promise<true>

Defined in: verify2/lib/verify2.ts:430

Deletes a template fragment by its unique identifier.

Parameters
templateId

string

The unique identifier of the template to delete.

fragmentId

string

The unique identifier of the template to delete.

Returns

Promise<true>

  • A promise that resolves when the template is successfully deleted.
Example

Delete a template by ID:

await templateClient.deleteTemplateFragment(
  '22f571c1-f41a-4db2-bba7-f23a069200c1'
  'c70f446e-997a-4313-a081-60a02a31dc19',
);
console.log('Template Fragment deleted successfully');
getConfig()
getConfig(): ConfigParams

Defined in: server-client/dist/lib/client.d.ts:36

Returns

ConfigParams

Inherited from

Client.getConfig

getTemplate()
getTemplate(templateId): Promise<Template>

Defined in: verify2/lib/verify2.ts:206

Retrieves a single template by its unique identifier.

Parameters
templateId

string

The unique identifier of the template to retrieve.

Returns

Promise<Template>

  • A promise resolving to the retrieved template in camelCase format.
Example

Get a template by ID:

const template = await templateClient.getTemplate('22f571c1-f41a-4db2-bba7-f23a069200c1');
console.log(template.name);
getTemplateFragment()
getTemplateFragment(templateId, fragmentId): Promise<TemplateFragment>

Defined in: verify2/lib/verify2.ts:364

Retrieves a single template fragment by its unique identifier.

Parameters
templateId

string

The unique identifier of the template.

fragmentId

string

The unique identifier of the template fragment.

Returns

Promise<TemplateFragment>

  • A promise resolving to the retrieved template fragment in snake_case format.
Example

Get a template fragment by ID:

const fragment = await templateClient.getTemplateFragment('22f571c1-f41a-4db2-bba7-f23a069200c1', 'c70f446e-997a-4313-a081-60a02a31dc19');
console.log(fragment.text);
getTemplateFragmentPage()
getTemplateFragmentPage(params): Promise<TemplateFragmentPage>

Defined in: verify2/lib/verify2.ts:286

Retrieves a page of template fragments based on the provided pagination and filter parameters.

Parameters
params

ListAllTemplateFragmentsParams

The filter parameters for pagination (e.g., page number, page size, template ID).

Returns

Promise<TemplateFragmentPage>

  • A promise resolving to a page of template fragments.
Example

Get a page of template fragments:

const fragmentPage = await templateClient.getTemplateFragmentPage({
  templateId: '22f571c1-f41a-4db2-bba7-f23a069200c1',
  page: 1,
  pageSize: 10,
});
fragmentPage._embedded.template_fragments.forEach(fragment => {
  console.log(fragment.text);
});
getTemplatePage()
getTemplatePage(params): Promise<TemplatePage>

Defined in: verify2/lib/verify2.ts:142

Retrieves a single page of templates based on the provided pagination parameters.

Parameters
params

ListAllTemplatesParams = {}

The filter parameters for pagination (e.g., page number, page size).

Returns

Promise<TemplatePage>

  • A promise resolving to a page of templates.
Example

Get a single page of templates:

const templatePage = await templateClient.getTemplatePage({
  page: 1,
  pageSize: 10
});

templatePage.templates.forEach(template => {
  console.log(template.name);
});
listAllTemplateFragments()
listAllTemplateFragments(params?): AsyncGenerator<TemplateFragment, void, undefined>

Defined in: verify2/lib/verify2.ts:337

Generator function to list all templates across multiple pages.

Parameters
params?

ListAllTemplateFragmentsParams

Optional filter parameters, including pagination.

Returns

AsyncGenerator<TemplateFragment, void, undefined>

Remarks

This will continue calling the API to retrieve all templates until there are no more pages left. The function yields each template in camelCase format.

Yields
  • Yields each template object in camelCase format.
Examples

List all templates using pagination:

for await (const template of templateClient.listAllTemplateFragments({ pageSize: 5 })) {
  console.log(template.name);
}

List all templates without pagination:

for await (const template of templateClient.listAllTemplateFragments()) {
  console.log(template.name);
}
listAllTemplates()
listAllTemplates(params?): AsyncGenerator<Template, void, undefined>

Defined in: verify2/lib/verify2.ts:108

Generator function to list all templates across multiple pages.

Parameters
params?

ListAllTemplatesParams = {}

Optional filter parameters, including pagination.

Returns

AsyncGenerator<Template, void, undefined>

Remarks

This will continue calling the API to retrieve all templates until there are no more pages left. The function yields each template in camelCase format.

Yields
  • Yields each template object in camelCase format.
Examples

List all templates using pagination:

for await (const template of templateClient.listAllTemplates({ pageSize: 5 })) {
  console.log(template.name);
}

List all templates without pagination:

for await (const template of templateClient.listAllTemplates()) {
  console.log(template.name);
}
newRequest()
newRequest(params): Promise<Request>

Defined in: verify2/lib/verify2.ts:35

Creates a new verification request.

Parameters
params

VerificationRequestParams

The parameters for the verification request.

Returns

Promise<Request>

A Request object containing the request ID.

parseResponse()
protected parseResponse<T>(request, response): Promise<VetchResponse<T>>

Defined in: server-client/dist/lib/client.d.ts:168

Parses the response based on its content type.

Type Parameters

T

The expected type of the parsed response data.

Parameters
request

VetchOptions

The request options.

response

Response

The raw response from the request.

Returns

Promise<VetchResponse<T>>

  • The parsed response.
Inherited from

Client.parseResponse

prepareBody()
protected prepareBody(request): undefined | string

Defined in: server-client/dist/lib/client.d.ts:158

Prepares the body for the request based on the content type.

Parameters
request

VetchOptions

The request options.

Returns

undefined | string

  • The prepared request body as a string or undefined.
Inherited from

Client.prepareBody

prepareRequest()
protected prepareRequest(request): Promise<VetchOptions>

Defined in: server-client/dist/lib/client.d.ts:151

Prepares the request with necessary headers, authentication, and query parameters.

Parameters
request

VetchOptions

The initial request options.

Returns

Promise<VetchOptions>

  • The modified request options.
Inherited from

Client.prepareRequest

sendDeleteRequest()
sendDeleteRequest<T>(url): Promise<VetchResponse<T>>

Defined in: server-client/dist/lib/client.d.ts:78

Sends a DELETE request to the specified URL.

Type Parameters

T

Parameters
url

string

The URL endpoint for the DELETE request.

Returns

Promise<VetchResponse<T>>

  • The response from the DELETE request.
Inherited from

Client.sendDeleteRequest

sendFormSubmitRequest()
sendFormSubmitRequest<T>(url, payload?): Promise<VetchResponse<T>>

Defined in: server-client/dist/lib/client.d.ts:86

Sends a POST request with form data to the specified URL.

Type Parameters

T

Parameters
url

string

The URL endpoint for the POST request.

payload?

Record<string, undefined | string>

Optional payload containing form data to send with the POST request.

Returns

Promise<VetchResponse<T>>

  • The response from the POST request.
Inherited from

Client.sendFormSubmitRequest

sendGetRequest()
sendGetRequest<T>(url, queryParams?): Promise<VetchResponse<T>>

Defined in: server-client/dist/lib/client.d.ts:94

Sends a GET request to the specified URL with optional query parameters.

Type Parameters

T

Parameters
url

string

The URL endpoint for the GET request.

queryParams?

Optional query parameters to append to the URL. These should be compatible with Node's URLSearchParams.

Returns

Promise<VetchResponse<T>>

  • The response from the GET request.
Inherited from

Client.sendGetRequest

sendPatchRequest()
sendPatchRequest<T>(url, payload?): Promise<VetchResponse<T>>

Defined in: server-client/dist/lib/client.d.ts:104

Sends a PATCH request to the specified URL with an optional payload.

Type Parameters

T

Parameters
url

string

The URL endpoint for the PATCH request.

payload?

Optional payload to be sent as the body of the PATCH request.

Returns

Promise<VetchResponse<T>>

  • The response from the PATCH request.
Inherited from

Client.sendPatchRequest

sendPostRequest()
sendPostRequest<T>(url, payload?): Promise<VetchResponse<T>>

Defined in: server-client/dist/lib/client.d.ts:114

Sends a POST request to the specified URL with an optional payload.

Type Parameters

T

Parameters
url

string

The URL endpoint for the POST request.

payload?

Optional payload to be sent as the body of the POST request.

Returns

Promise<VetchResponse<T>>

  • The response from the POST request.
Inherited from

Client.sendPostRequest

sendPutRequest()
sendPutRequest<T>(url, payload?): Promise<VetchResponse<T>>

Defined in: server-client/dist/lib/client.d.ts:124

Sends a PUT request to the specified URL with an optional payload.

Type Parameters

T

Parameters
url

string

The URL endpoint for the PUT request.

payload?

Optional payload to be sent as the body of the PUT request.

Returns

Promise<VetchResponse<T>>

  • The response from the PUT request.
Inherited from

Client.sendPutRequest

sendRequest()
sendRequest<T>(request): Promise<VetchResponse<T>>

Defined in: server-client/dist/lib/client.d.ts:144

Sends a request adding necessary headers, handling authentication, and parsing the response.

Type Parameters

T

Parameters
request

VetchOptions

The options defining the request, including URL, method, headers, and data.

Returns

Promise<VetchResponse<T>>

  • The parsed response from the request.
Inherited from

Client.sendRequest

sendRequestWithData()
sendRequestWithData<T>(
   method, 
   url, 
payload?): Promise<VetchResponse<T>>

Defined in: server-client/dist/lib/client.d.ts:135

Sends a request with JSON-encoded data to the specified URL using the provided HTTP method.

Type Parameters

T

Parameters
method

The HTTP method to be used for the request (only POST, PATCH, or PUT are acceptable).

POST | PUT | PATCH

url

string

The URL endpoint for the request.

payload?

Optional payload to be sent as the body of the request, JSON-encoded.

Returns

Promise<VetchResponse<T>>

  • The response from the request.
Inherited from

Client.sendRequestWithData

updateTemplate()
updateTemplate(template): Promise<Template>

Defined in: verify2/lib/verify2.ts:251

Updates an existing template with the provided details.

Parameters
template

Template

The full template object with updated details. The template must include its ID.

Returns

Promise<Template>

  • A promise resolving to the updated template in camelCase format.
Example

Update a template:

const updatedTemplate = await templateClient.updateTemplate({
  templateId: '22f571c1-f41a-4db2-bba7-f23a069200c1',
  name: 'Updated Template Name',
  isDefault: false,
});
console.log(updatedTemplate.name);
updateTemplateFragment()
updateTemplateFragment(templateId, fragment): Promise<Template>

Defined in: verify2/lib/verify2.ts:461

Updates an existing template with the provided details.

Parameters
templateId

string

The ID of the template this fragment belongs to.

fragment

TemplateFragment

The full template fragment object with updated details.

Returns

Promise<Template>

  • A promise resolving to the updated template fragment in camelCase format.
Example

Update a template:

const updatedTemplateFragment = await templateClient.updateTemplateFragment(
 '22f571c1-f41a-4db2-bba7-f23a069200c1',
  {
    templateId: '22f571c1-f41a-4db2-bba7-f23a069200c1',
    name: 'Updated Template Name',
    isDefault: false,
  }
);
console.log(updatedTemplateFragment.name);

Interfaces

ListAllTemplatesParams

Defined in: verify2/lib/types/params/listAllTemplateParams.ts:4

Query parameters for listing all templates in the Verify API.

Properties

page?
optional page: number;

Defined in: verify2/lib/types/params/listAllTemplateParams.ts:15

The page number to retrieve.

Example
2
pageSize?
optional pageSize: number;

Defined in: verify2/lib/types/params/listAllTemplateParams.ts:9

The number of templates to return per page.

Example
10

Type Aliases

CheckCodeRequest

type CheckCodeRequest = object;

Defined in: verify2/lib/types/requests/checkCodeRequest.ts:4

Represents a request to check a code against a verification request.

Type declaration

code
code: string;

The code to be checked against the verification request.


CheckRequestResponse

type CheckRequestResponse = object;

Defined in: verify2/lib/types/responses/checkRequestResponse.ts:4

Represents the response for checking a code against a verification request.

Type declaration

request_id
request_id: string;

The ID of the verification request.

status
status: string;

The status of the verification request.


CreateTemplateFragmentRequest

type CreateTemplateFragmentRequest = object;

Defined in: verify2/lib/types/requests/createTemplateFragmentRequest.ts:4

Represents the request body for creating a template fragment.

Type declaration

channel
channel: "sms" | "voice";

The communication channel for the fragment (e.g., sms, voice, email).

Example
"sms"
locale
locale: string;

Locale in IETF BCP 47 format.

Example
"en-us"
text
text: string;

Text content of the template fragment.

Example
"Text content of the template. May contain 4 reserved variables: `${code}`, `${brand}`, `${time-limit}` and `${time-limit-unit}`"

EmailWorkflow

type EmailWorkflow = object;

Defined in: verify2/lib/types/workflows/emailWorkflow.ts:6

Represents a workflow for sending a verification code via email.

Type declaration

channel
channel: EMAIL;

The communication channel for sending the verification code.

from?
optional from: string;

(Optional) The sender's email address for the verification email.

to
to: string;

The recipient's email address where the verification code will be sent.


EventCallback

type EventCallback = object;

Defined in: verify2/lib/types/eventCallback.ts:6

Represents an event callback received for a verification request.

Type declaration

channel
channel: Channels;

The communication channel for the verification request.

client_ref?
optional client_ref: string;

(Optional) The client reference given in the original Verify request.

finalized_at
finalized_at: string;

The date and time when the verification request was completed in ISO 8601 format.

request_id
request_id: string;

The ID of the verification request associated with the event.

status
status: EventStatus;

The status of the event.

triggerd_at
triggerd_at: string;

The date and time when the event was triggered in ISO 8601 format.

type
type: string;

The type of response for the event.


ListAllTemplateFragmentsParams

type ListAllTemplateFragmentsParams = object & ListAllTemplatesParams;

Defined in: verify2/lib/types/params/listAllTemplateFragmentsParams.ts:6

Query parameters for listing all template fragments, including pagination.

Type declaration

templateId
templateId: string;

The template ID to retrieve fragments for.

Example
"22f571c1-f41a-4db2-bba7-f23a069200c1"

ListAllTemplateFragmentsResponse

type ListAllTemplateFragmentsResponse = object;

Defined in: verify2/lib/types/responses/listAllTemplateFragmentsResponse.ts:7

The response when listing all template fragments, including pagination.

Type declaration

_embedded
_embedded: object;

The list of template fragments.

_embedded.template_fragments
_embedded.template_fragments: TemplateFragmentResponse[];
_links
_links: APILinks["_links"];

Pagination links in HAL format.

page
page: number;

The current page number.

Example
2
page_size
page_size: number;

The number of fragments returned in the current page.

Example
10
total_items
total_items: number;

Total number of template fragments available.

Example
25
total_pages
total_pages: number;

Total number of pages available.

Example
5

ListAllTemplatesResponse

type ListAllTemplatesResponse = object;

Defined in: verify2/lib/types/responses/listAllTemplatesResponse.ts:8

The response when listing all templates, including pagination.

Type declaration

_embedded
_embedded: object;

The list of templates.

_embedded.templates
_embedded.templates: TemplateResponse[];
_links
_links: APILinks["_links"];

Pagination links in HAL format.

page
page: number;

The current page number.

Example
2
page_size
page_size: number;

The number of templates returned in the current page.

Example
1
templates
templates: Template[];

The list of templates transformed into the SDK format.

total_items
total_items: number;

Total number of templates available.

Example
25
total_pages
total_pages: number;

Total number of pages available.

Example
10

Request

type Request = object;

Defined in: verify2/lib/types/request.ts:4

Represents a request object with a unique request ID.

Type declaration

checkUrl?
optional checkUrl: string;

The URL to check the status of the request.

requestId
requestId: string;

The unique identifier for the request.


RequestStatusCallback

type RequestStatusCallback = object;

Defined in: verify2/lib/types/requestStatusCallback.ts:8

Represents a callback received for the status update of a verification request.

Type declaration

channel_timeout
channel_timeout: number;

The number of seconds before the current step in the verification request times out.

request_id
request_id: string;

The ID of the verification request associated with the callback.

status
status: RequestStatus;

The status of the verification request.

submitted_at
submitted_at: string;

The date and time when the verification request was submitted in ISO 8601 format.

type
type: string;

The type of response for the callback.

workflow
workflow: RequestStatusCallbackWorkflow[];

An array of workflow details for the verification request.


RequestStatusCallbackWorkflow

type RequestStatusCallbackWorkflow = object;

Defined in: verify2/lib/types/workflows/requestStatusCallbackWorkflow.ts:6

Represents a workflow step within a verification request's status callback.

Type declaration

channel
channel: Channels;

The communication channel associated with this workflow step.

initiated_at
initiated_at: string;

The date and time when this workflow step was initiated in ISO 8601 format.

status
status: RequestWorkflowStatus;

The status of this workflow step within the verification request.


SilenAuthChannel

type SilenAuthChannel = SilentAuthChannel;

Defined in: verify2/lib/enums/channels.ts:44

Type alias for the Silent Authentication channel.


SilentAuthCallback

type SilentAuthCallback = object;

Defined in: verify2/lib/types/silentAuthCallback.ts:6

Represents a callback received for Silent Authentication.

Type declaration

action
action: object;

Information about the action in the Silent Authentication event.

action.check_url
action.check_url: string;

The URL for Silent Authentication Verify workflow completion.

action.type
action.type: "check";

The type of action, which is 'check' for Silent Authentication.

channel
channel: SILENT_AUTH;

The communication channel for Silent Authentication (always 'silent_auth').

request_id
request_id: string;

The ID of the Silent Authentication request associated with the callback.

status
status: SilenAuthStatus;

The status of the Silent Authentication event.

triggerd_at
triggerd_at: string;

The date and time when the Silent Authentication event was triggered in ISO 8601 format.

type
type: string;

The type of response for the Silent Authentication event.


SilentAuthWorkflow

type SilentAuthWorkflow = object;

Defined in: verify2/lib/types/workflows/silentAuthWorkflow.ts:6

Represents a workflow for Silent Authentication.

Type declaration

channel
channel: SilentAuthChannel;

The communication channel for Silent Authentication.

redirectUrl
redirectUrl: string;

The redirect URL for Silent Authentication.

to
to: string;

The target identifier for Silent Authentication.


SilentAuthWorkflowRequest

type SilentAuthWorkflowRequest = object & Omit<SilentAuthWorkflow, "redirectUrl">;

Defined in: verify2/lib/types/requests/verificationRequest.ts:19

Type declaration

redirect_url
redirect_url: string;

SMSWorkflow

type SMSWorkflow = object;

Defined in: verify2/lib/types/workflows/smsWorkflow.ts:6

Represents a workflow for sending a verification code via SMS.

Type declaration

appHash?
optional appHash: string;

(Optional) An application-specific hash value for the SMS workflow.

channel
channel: SMS;

The communication channel for sending the verification code.

contentId?
optional contentId: string;

Optional value corresponding to a TemplateID for SMS delivery using Indian Carriers

entityId?
optional entityId: string;

Optional PEID required for SMS delivery using Indian Carriers

from?
optional from: string;

An optional sender number, in the E.164 format. Don't use a leading + or 00 when entering a phone number, start with the country code, for example, 447700900000.

Remarks

If no from number is given, the request will default to the brand.

to
to: string;

The recipient's phone number where the verification code will be sent, in the E.164 format.


SMSWorkflowRequest

type SMSWorkflowRequest = object & Omit<SMSWorkflow, "appHash">;

Defined in: verify2/lib/types/requests/verificationRequest.ts:11

Type declaration

app_hash?
optional app_hash: string;
content_id?
optional content_id: string;
entity_id?
optional entity_id: string;

Template

type Template = object;

Defined in: verify2/lib/types/template.ts:4

Represents a value object for a template, converted to camelCase, without _links.

Type declaration

isDefault
isDefault: boolean;

Indicates whether this is the default template.

Example
true
name
name: string;

The name of the template.

Example
"my-template"
templateId
templateId: string;

Unique identifier for the template.

Example
"8f35a1a7-eb2f-4552-8fdf-fffdaee41bc9"

TemplateFragment

type TemplateFragment = object;

Defined in: verify2/lib/types/templateFragment.ts:4

Represents a template fragment

Type declaration

channel
channel: "sms" | "voice";

The communication channel for the fragment (e.g., sms, voice).

Example
"sms"
dateCreated
dateCreated: string;

The date when the template fragment was created, in ISO 8601 format.

Example
"2021-08-30T20:12:15.17865735Z"
dateUpdated
dateUpdated: string;

The date when the template fragment was last updated, in ISO 8601 format.

Example
"2023-08-30T15:20:15.17865735Z"
locale
locale: string;

Locale in IETF BCP 47 format.

Example
"en-us"
templateFragmentId
templateFragmentId: string;

Unique identifier for the template fragment.

Example
"c70f446e-997a-4313-a081-60a02a31dc19"
text
text: string;

Text content of the template fragment.

Example
"Text content of the template. May contain 4 reserved variables: `${code}`, `${brand}`, `${time-limit}` and `${time-limit-unit}`"

TemplateFragmentPage

type TemplateFragmentPage = object;

Defined in: verify2/lib/types/templateFragmentPage.ts:7

Value object for a page of template fragments, with camelCase properties.

Type declaration

fragments
fragments: TemplateFragment[];

The list of template fragments.

links?
optional links: Record<string, APILink>;

The set of links for the current page.

page
page: number;

The current page number.

Example
2
pageSize
pageSize: number;

The number of fragments returned in the current page.

Example
10
totalItems
totalItems: number;

Total number of template fragments available.

Example
25
totalPages
totalPages: number;

Total number of pages available.

Example
5

TemplateFragmentResponse

type TemplateFragmentResponse = object;

Defined in: verify2/lib/types/responses/templateFragmentResponse.ts:6

Represents the response when retrieving a template fragment.

Type declaration

_links
_links: object;

HAL format links related to the template fragment.

_links.self
_links.self: APILink;

A link to the template fragment itself.

_links.template
_links.template: APILink;

A link to the parent template this fragment belongs to.

channel
channel: "sms" | "voice";

The communication channel for the fragment (e.g., sms, voice, email).

Example
"sms"
date_created
date_created: string;

The date when the template fragment was created, in ISO 8601 format.

Example
"2021-08-30T20:12:15.17865735Z"
date_updated
date_updated: string;

The date when the template fragment was last updated, in ISO 8601 format.

Example
"2023-08-30T15:20:15.17865735Z"
locale
locale: string;

Locale in IETF BCP 47 format.

Example
"en-us"
template_fragment_id
template_fragment_id: string;

Unique identifier for the template fragment.

Example
"c70f446e-997a-4313-a081-60a02a31dc19"
text
text: string;

Text content of the template fragment.

Example
"Text content of the template. May contain 4 reserved variables: `${code}`, `${brand}`, `${time-limit}` and `${time-limit-unit}`"

TemplatePage

type TemplatePage = object;

Defined in: verify2/lib/types/templatePage.ts:7

Value object for a page of templates with camelCase properties.

Type declaration

links?
optional links: Record<string, APILink>;

The set of links for the current page.

page
page: number;

The current page number.

Example
2
pageSize
pageSize: number;

The number of templates returned in the current page.

Example
10
templates
templates: Template[];

The list of templates.

totalItems
totalItems: number;

Total number of template available.

Example
25
totalPages
totalPages: number;

Total number of pages available.

Example
5

TemplateResponse

type TemplateResponse = object;

Defined in: verify2/lib/types/responses/templateResponse.ts:6

Represents a single template in the Verify API response.

Type declaration

_links
_links: object;

HAL format links related to the template.

_links.fragments
_links.fragments: APILink;

A link to the template fragments associated with this template.

_links.self
_links.self: APILink;

A link to the template itself.

is_default
is_default: boolean;

Indicates whether this is the default template.

Example
true
name
name: string;

The name of the template.

Example
"my-template"
template_id
template_id: string;

Unique identifier for the template.

Example
"8f35a1a7-eb2f-4552-8fdf-fffdaee41bc9"

VerificationRequest

type VerificationRequest = object;

Defined in: verify2/lib/types/requests/verificationRequest.ts:26

Represents a verification request for sending verification codes via different communication channels.

Type declaration

brand
brand: string;

The brand associated with the verification request.

channel_timeout?
optional channel_timeout: number;

(Optional) The timeout duration for the verification channel in seconds.

client_ref?
optional client_ref: string;

(Optional) The client reference associated with the verification request.

code?
optional code: string;

(Optional) The verification code to be sent.

code_length?
optional code_length: 4 | 5 | 6 | 7 | 8 | 9 | 10;

(Optional) The length of the verification code, if not provided, defaults to 4 digits.

fraud_check?
optional fraud_check: boolean;

(Optional) Indicates whether fraud checking is enabled for the verification request.

locale?
optional locale: VerifyLocale | string;

(Optional) The locale for the verification request.

workflow
workflow: (
  | EmailWorkflow
  | SMSWorkflowRequest
  | SilentAuthWorkflowRequest
  | VoiceWorkflow
  | WhatsAppInteractiveWorkflow
  | WhatsAppWorkflow)[];

An array of workflow configurations for sending verification codes via different channels. Each element in the array corresponds to a specific channel workflow.


VerificationRequestParams

type VerificationRequestParams = object;

Defined in: verify2/lib/types/params/verifcationRequestParams.ts:15

Represents parameters for creating a verification request for sending verification codes via different communication channels.

Type declaration

brand
brand: string;

The brand associated with the verification request.

channelTimeout?
optional channelTimeout: number;

(Optional) The timeout duration for the verification channel in seconds.

clientRef?
optional clientRef: string;

(Optional) The client reference associated with the verification request.

code?
optional code: string;

(Optional) The verification code to be sent.

codeLength?
optional codeLength: 4 | 5 | 6 | 7 | 8 | 9 | 10;

(Optional) The length of the verification code, if not provided, defaults to 4 digits.

fraudCheck?
optional fraudCheck: boolean;

(Optional) Indicates whether fraud checking is enabled for the verification request.

locale?
optional locale: VerifyLocale | string;

(Optional) The locale for the verification request.

templateId?
optional templateId: string;

A custom template ID to use for the verification request.

Remarks

Only voice and sms workflows support custom templates.

workflow
workflow: (
  | EmailWorkflow
  | SMSWorkflow
  | SilentAuthWorkflow
  | VoiceWorkflow
  | WhatsAppInteractiveWorkflow
  | WhatsAppWorkflow)[];

An array of workflow configurations for sending verification codes via different channels. Each element in the array corresponds to a specific channel workflow.


VerificationResponse

type VerificationResponse = object;

Defined in: verify2/lib/types/responses/verificationResponse.ts:4

Represents a response for a verification request.

Type declaration

check_url?
optional check_url: string;

The URL for checking the status of the verification request.

request_id
request_id: string;

The unique identifier for the verification request.


VerifyErrors

type VerifyErrors = object & GenericErrors;

Defined in: verify2/lib/enums/verifyErrors.ts:6

Type representing possible errors related to verification requests.

Type declaration

CONFLICT
CONFLICT: "conflict";

Indicates a conflict error in the verification request.

EXPIRED
EXPIRED: "expired";

Indicates that the verification request has expired.


VoiceWorkflow

type VoiceWorkflow = object;

Defined in: verify2/lib/types/workflows/voiceWorkflow.ts:6

Represents a workflow for sending a verification code via voice call.

Type declaration

channel
channel: VOICE;

The communication channel for sending the verification code.

to
to: string;

The recipient's phone number where the verification code will be sent, in the E.164 format.


WhatsAppInteractiveWorkflow

type WhatsAppInteractiveWorkflow = object;

Defined in: verify2/lib/types/workflows/whatsAppInteractiveWorkflow.ts:7

Represents a workflow for sending a verification code via interactive WhatsApp.

Type declaration

channel
channel: WHATSAPP_INTERACTIVE;

The communication channel for sending the verification code.

to
to: string;

The recipient's phone number where the verification code will be sent, typically in the E.164 format.


WhatsAppWorkflow

type WhatsAppWorkflow = object;

Defined in: verify2/lib/types/workflows/whatsAppWorkflow.ts:6

Represents a workflow for sending a verification code via WhatsApp.

Type declaration

channel
channel: WHATSAPP;

The communication channel for sending the verification code.

from?
optional from: string;

(Optional) The sender's phone number or identifier for the WhatsApp message.

to
to: string;

The recipient's phone number where the verification code will be sent, typically in the E.164 format.

Clone this wiki locally