# Actions

# Introduction

Actions are separate verification processes that are performed independently of the main applicant verification and do not affect its outcome. Applicant actions can be selected in the verification level settings.

Actions can be triggered by specific events. For example, when you need to verify that the account owner is the one currently using the account. In this case, the action «Face Authorization» is initiated.

Warning:

Actions should only be initiated for profiles that have successfully passed verification and have been approved (status «completed: approved»).

Currently, we offer the following types of action verifications:

  • Face authorization For successful verification, the face in the selfie (liveness or webcam photo) must match the face from the main profile.
  • Email verification
  • Source check
  • Questionnaire

# Setting up a verification level

To use actions:

  1. In the Dashboard, open the «Integration» page, tab «Individuals».
  2. Click «Create Level».
  3. In the «General» section, select «Applicant actions» from the «Type» dropdown.
  4. In the «Required Steps» section, remove all verification steps except «Selfie».
  5. In the «Action type» dropdown, select the type of action.
  6. Complete the verification level setup and save the changes.

The results of actions can be obtained from the applicant or via webhooks.

# API Requests for actions

All API requests must be authenticated as described in the Getting Started section.

# POST Create applicant action

Use this request to create applicant actions.

POST /resources/applicantActions/-/forApplicant/{applicantId}?levelName={levelName}

Request parameters

Name Type Required Description
applicantId String Yes Unique identifier of the applicant in our system.

Query parameters

Name Type Required Description
levelName String Yes The name of the verification level containing the action check, as configured in the «Application Levels» section of the Dashboard.

Request body

Name Type Required Description
externalActionId String Yes External identifier of the action.
questionnaires Array No Array with questionnaire parameters.
email String No User's email address.
phone String No User's phone number.

Example

# POST Generate external WebSDK link for applicant action

POST /resources/sdkIntegrations/levels/{levelName}/websdkLink?externalUserId={externalUserId}&externalActionId={externalActionId}

Request parameters

Name Type Required Description
levelName String Yes The name of the verification level containing the action check, as configured in the «Application Levels» section of the Dashboard.

Query parameters

Name Type Required Description
externalUserId String Yes External applicant identifier — the unique identifier of the user in your system. Required if you want to create a link for a specific applicant.
externalActionId String Yes External action ID. Required only for creating a link to an applicant action.
locale String No WebSDK language in ISO 639-1 format.
ttlInSecs Integer No Connection lifetime in seconds (default — 1800).

Response

Name Type Description
url String Link to perform the verification.

Example

# POST Add image to applicant action

This endpoint adds an image to an action (for example, a face photo for “Face Authorization”).

POST /resources/applicantActions/{actionId}/images

Request parameters

Name Type Required Description
actionId String Yes Identifier of the action.

You can obtain the action ID when creating a new action or by using the “GET Get actions of an applicant” request.

Request headers

Name Type Value
Content-Type String multipart/form-data

Request body

Name Type Required Description
metadata Object Yes Object representing the action type.
content Binary Yes Photo of the document.

Fields of the metadata object

Name Type Required Description
idDocType String Yes Document type.
country String Yes Three-letter country code Alpha-3 (for example, RUS).

Response

If the request is successfully processed, the response contains a JSON file with image information.

Name Type Description
id String Identifier of the image object.
addedDate Date Upload date and time (UTC).
imageHash String Checksum of the image file.
imageFileName String Name of the image file.
resizedImageId String Identifier of the resized image.
mimeType String Media type of the image.
sigHash String Signed hash of the image.
imageId String Identifier of the image.
actualResolution Object Actual width and height of the image in pixels.
answer String Result of the image verification. Available values: GREEN/YELLOW/RED/ERROR.
idDocDef Object Additional information about the document/selfie.
reviewResult Object Additional information on image verification results. Empty until the action check is completed.
attemptId String Identifier of the upload attempt.

Fields of the idDocDef object

Name Type Description
country String Three-letter country code Alpha-3 (for example, RUS).
idDocType String Document type.
idDocSubType String FRONT_SIDE, BACK_SIDE, or null.

Example

# POST Submit action for review

Use this endpoint to request a verification of an action.

The status of the action is set to pending, after which the action is ready for processing.

POST /resources/applicantActions/{actionId}/review/status/pending

Request parameters

Name Type Required Description
actionId String Yes Identifier of the action.

You can obtain the action ID when creating a new action or by using the “GET Get actions of an applicant” request.

Example

# GET Get action review result

GET /resources/applicantActions/{actionId}/one

Request parameters

Name Type Required Description
actionId String Yes Identifier of the action.

You can obtain the action ID when creating a new action or by using the “GET Get actions of an applicant” request.

Response

Name Type Required Description
review Object Yes Information about the review results.
checks Array No List of checks performed as part of this action.
images Array No List of images associated with the action.

Fields of review object

Name Type Required Description
reviewStatus String Yes Status of the action review.
reviewResult String Yes, upon completion Result of the review.

Fields of reviewResult object

Name Type Required Description
reviewAnswer String Yes Review result: GREEN, RED, or ERROR.
rejectLabels Array No Rejection tags, if any.

Example

# GET Get actions of an applicant

This endpoint allows you to retrieve a list of actions that belong to an applicant.

GET /resources/applicantActions/-;applicantId={applicantId}?limit={limit}&offset={offset}&order=-createdAt

Request parameters

Name Type Required Description
applicantId String Yes Unique identifier of the applicant in our system.

Query parameters

Name Type Required Description
limit Integer No Maximum number of actions to return (default — 1000).
offset Integer No Offset for the list of actions to return (default — 10).

Response

The response contains a list of actions and the total count.

The list element contains the actions, whose structure is described in the section “GET Get action review result”.

Example

# GET Get original image

GET /resources/applicantActions/{actionId}/images/{imageId}?preview={isPreview}

Request body

Name Type Required Description
actionId String Yes Identifier of the action.
imageId String Yes Identifier of the image from images[].imageId.

Query parameters

Name Type Required Description
isPreview Boolean No Whether to return an image preview (default — false).

# Applicant actions in WebSDK

Initialize WebSDK with externalActionId as described in the sections WebSDK and Getting Started.

Generate access token for actions:
POST /resources/accessTokens?userId={externalUserId}&externalActionId={externalActionId}&levelName={levelName}

Example

# Applicant actions for Android SDK

Initialize the Android SDK with externalActionId as described in the sections Android SDK and Getting Started.

Use the additional state to handle the result of the action.

When processing the «Face Authorization» action, the user is taken to the FaceScan (Liveness) screen, and after the check is completed, the SDK automatically closes.

# Notification of action results

To receive the result of an action and manage the action process, you can use this handler.

The handler accepts two parameters:

  • actionId : String — ID of the action.
  • answer : String — response from the liveness check module.

Possible values:

  • GREEN
  • YELLOW
  • RED
  • ERROR
  • null

The handler should return CBRActionResult. The following values are supported:

  • CBRActionResult.Continue — continue the default action scenario (show result screen, etc.).
  • CBRActionResult.Cancel — cancel the default action scenario (close SDK without showing the result screen).

# Applicant actions for iOS SDK

Initialize the iOS SDK with externalActionId as described in the iOS SDK and Getting Started sections.

The «Face Authorization» actions are handled as follows:

  • During the «Face Authorization» action, the user is taken to the FaceScan (Liveness) screen, and after the check is completed, the SDK automatically closes.
  • After the process is completed, the sdk.status property is set to .actionCompleted, and sdk.actionResult contains the result of the last performed action.
  • To determine the SDK status and get the action result, you can use one of the following callbacks: onDidDismiss, dismissHandler, or onStatusDidChange.
sdk.onDidDismiss { (sdk) in
    switch sdk.status {
    case .failed:
        print("failReason: [\(sdk.description(for: sdk.failReason))] - \(sdk.verboseStatus)")
    case .actionCompleted:
        // the Face authentication action was performed or cancelled
        if  let result = sdk.actionResult {
            print("Face Auth action result: actionId=\(result.actionId) answer=\(result.answer  ??  "<none>")")
        } else {
            print("Face Auth action was cancelled")
        }
    default:
        // in case of Face authentication action, the other statuses are not used for now,
        // but you could see them if the user closes the sdk before the level is loaded
        break
    }
}

# Notification of action results

The result of the «Face Authorization» action is represented by the sdk.actionResult property, which includes the following fields:

Field Type Description
actionId String Identifier of the action.
answer String Result of the action check. Possible values: GREEN, RED, or ERROR.

The absence of sdk.actionResult means that the user canceled the verification process.

# Handling the action check result

For «Face Authorization» actions, an optional handler actionResultHandler is available, which allows processing the result after it is received from the server. At this point, the user sees the processing screen (Processing).

sdk.actionResultHandler { (sdk, result, onComplete) in
    print("Face Auth action result handler: actionId=\(result.actionId) answer=\(result.answer  ??  "<none>")")
    // you are allowed to process the result asynchronously, just don't forget to call `onComplete` when you finish,
    // you could pass `.cancel` to force the user interface to close, or `.continue` to proceed as usual
    onComplete(.continue)
}

# Webhooks

The types of webhooks we send depend on the settings in the «Dev space» section.

Name Description
applicantActionPending The user has completed all required steps, and the action has been set to pending status.
applicantActionReviewed The action verification has been completed.
applicantActionOnHold Processing of the action has been paused for an agreed reason.

For more information about webhooks, see here.

Example of webhook payload