• Overview
  • eKYC Platform
  • Face Authentication
  • Vision Score
  • Behavioral Biometric (BehavioIQ)
  • SIM Verification
  • Mule Account Database
  • eKYC Core
  • Demo Apps
TrustVision API Documentation

Mule Account Database API

The Mule Account Database API helps identify and flag accounts suspected of being used for money-mule activity. Use it to report a suspected mule account together with the identity information you have on it, and to search for a suspected mule account using identity information or a facial image.

Report Mule Account

The report mule account service allows one to report a suspected mule account with their identity information.

1. Request

MethodPathContent-TypeAuth Required
POST/v1/report_mule_accountapplication/jsonYes

Request Body:

JSON
{
    "image": {
        "id": string,
        "base64": string,
        "label": string,
        "metadata": json,
        "embedding": []float
    },
    "account_identifier": {
        "national_id": string,
        "identifier_type": string,
        "flag": string,
        "country": string,
        "dob": string,
        "first_name": string,
        "last_name": string,
        "middle_name": string,
        "metadata": JSON
    }
}

Where

NameTypeRequiredDescription
imageJSONNoImage of the identity card's front side.
account_identifierJSONYesContains info about the account holder's identity.

Which each image's parameters contains:

NameTypeRequiredDescription
idstringNoID of image is returned from API Upload
base64stringNobase64 encoded text of image data
labelstringNolabel of the image as described at Label table
metadatastring_jsonNokey-value string, key should be string, value should be string, int, float, bool. Example "{\"id\":\"123456789\",\"type\":1}"
embedding[]floatNoVector embedding of the face in the image.

Note:

  • If you use id, omit base64, label, metadata, and embedding.

  • If you use base64, you can also include label and metadata. Omit id and embedding.

  • If you use embedding, omit all other image parameters.

  • The priority order for processing is: id, then base64, then embedding.

Clients can provide image data to the TrustVision API by specifying the ID the image by using upload API, or by sending the image data as base64-encoded text.

The account_identifier object contains:

NameTypeRequiredDescription
national_idstringNoNational identification number.
identifier_typestringNoType of the identification document.
flagstringNoFlag to indicate the type of report: (reported, suspected, confirmed, blacklisted, convicted)
countrystringNoCountry that issued the ID, in ISO 3166-1 alpha-2 format (e.g., "vn").
dobstringNoDate of birth in YYYY-MM-DD format.
first_namestringNoFirst name of the account holder.
last_namestringNoLast name of the account holder.
middle_namestringNoMiddle name of the account holder.
metadataJSONNoAdditional key-value data.

Note:

  • At least one of the following must be provided: image OR national_id in account_identifier.

  • In the account_identifier object, at least one field (excluding the flag field) must be provided.

Authentication mechanism is described in Authentication.

Sample Request

bash
curl -X POST \
https://tv-staging.trustingsocial.com/api/v1/report_mule_account \
-H 'Authorization: TV <YOUR ACCESS KEY>:<CREATED SIGNATURE>' \
-H 'X-TV-Timestamp: 2019-04-21T18:00:15+07:00' \
-H 'Content-Type: application/json' \
-d \
'
{

    "account_identifier": {
        "national_id": "098765432109",
        "identifier_type": "national_id",
        "flag": 1,
        "country": "VN",
        "dob": "1995-08-15",
        "first_name": "B",
        "middle_name": "VĂN",
        "last_name": "NGUYỄN"
    },
    "image": {
        "id": "a4facba3-334b-41fb-97e3-4766cb70ae29",
    }
}
'

2. Response

The response will be a JSON with following format:

javascript
{
    "data": {
        "status": string, "success" or "failure"
        "id": string, // mule account face ID
        "message": string, "success" or "update_success" or "only_one_face_image_or_embedding"
        "metadata": JSON
    },
    "errors": [
            {
                "code": string,
                "message": string,
                "detail": {
                    "field": string, // optional, which parameter is invalid.
                    ... // any other information that can be useful for client
                },
            },
            ... // other errors
        ]
}

In case the request processing has been finished, the HTTP status code will be

200, and the data.status is either "success" or "failure" depending on whether the request has been successfully processed or not.

If the data.status is "failure", the "errors" field will tell you why it

failed.

error codedescription
image_too_blurthe input image is too blur
image_too_darkthe input image is too dark
image_too_brightthe input image is too bright (glare)

In case of any other errors, the data field will be empty, and the server sends one of the following HTTP status codes with an error code:

HTTP codeerror codedescription
401access_denied_exceptionYou are not authorized to perform the action.
400invalid_parameter_exceptionInput parameter violates a constraint.
400request_time_too_skewedThe X-TV-Timestamp header is expired, need a newer one.
404image_not_found_exceptionThe image ID is not found in DB.
404request_not_found_exceptionThe request ID is not found when polling result by id
408request_timeout_exceptionRequest takes too long to process
429rate_limit_exceptionThe number of requests exceeded your throughput limit.
500internal_server_errorSome unexpected error occurs while processing the request

Sample Response

JSON
{
    "data": {
        "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
        "message": "success",
        "metadata": {},
        "status": "success"
    }
}

Search Mule Account

This service allows you to search for a suspected mule account using their identity information or facial image.

1. Request

MethodPathContent-TypeAuth Required
POST/v1/search_mule_accountapplication/jsonYes

Request Body:

JSON
{
    "image": {
        "id": string,
        "base64": string,
        "label": string,
        "metadata": json,
        "embedding": []float
    },
    "account_identifier": {
        "national_id": string,
        "identifier_type": string,
        "country": string,
        "dob": string,
        "first_name": string,
        "last_name": string,
        "middle_name": string
    }
}

Where

NameTypeRequiredDescription
imageJSONNoImage of the identity card's front side.
account_identifierJSONYesContains info about the account holder's identity.

Which each image's parameters contains:

NameTypeRequiredDescription
idstringNoID of image is returned from API Upload
base64stringNobase64 encoded text of image data
labelstringNolabel of the image as described at Label table
metadatastring_jsonNokey-value string, key should be string, value should be string, int, float, bool. Example "{\"id\":\"123456789\",\"type\":1}"
embedding[]floatNoVector embedding of the face in the image.

Note:

  • If you use id, omit base64, label, metadata, and embedding.

  • If you use base64, you can also include label and metadata. Omit id and embedding.

  • If you use embedding, omit all other image parameters.

  • The priority order for processing is: id, then base64, then embedding.

Clients can provide image data to the TrustVision API by specifying the ID the image by using upload API, or by sending the image data as base64-encoded text.

The account_identifier object contains:

NameTypeRequiredDescription
national_idstringNoNational identification number.
identifier_typestringNoType of the identification document.
countrystringNoCountry that issued the ID, in ISO 3166-1 alpha-2 format (e.g., "vn").
dobstringNoDate of birth in YYYY-MM-DD format.
first_namestringNoFirst name of the account holder.
last_namestringNoLast name of the account holder.
middle_namestringNoMiddle name of the account holder.
metadataJSONNoAdditional key-value data.

Note:

  • At least one of the following must be provided: image OR national_id in account_identifier.

Authentication mechanism is described in Authentication.

Sample Request

bash
curl -X POST \
https://tv-staging.trustingsocial.com/api/v1/search_mule_account \
-H 'Authorization: TV <YOUR ACCESS KEY>:<CREATED SIGNATURE>' \
-H 'X-TV-Timestamp: 2019-04-21T18:00:15+07:00' \
-H 'Content-Type: application/json' \
-d \
'
{
    "account_identifier": {
        "national_id": "098765432109",
        "identifier_type": "national_id",
        "country": "VN",
        "dob": "1995-08-15",
        "first_name": "B",
        "middle_name": "VĂN",
        "last_name": "NGUYỄN"
    },
    "image": {
        "id": "a4facba3-334b-41fb-97e3-4766cb70ae29",
    }
}
'

2. Response

The response will be a JSON with following format:

javascript
{
    "data": {
        "status": string, // "success" or "failure"
        "verdict": string, // the highest level of flag found
        "matched": int, // number of mule account faces found
        "similar_face": int, // number of faces
        "mule_account_flags": []string // set of flags for each mule account face found
        "matched_face_counts": map[string]{matched,count} // statistics of matched faces
        "statistics_by_flag":map[string]int // statistics of matched faces by flag
    },
    "errors": [
            {
                "code": string,
                "message": string,
                "detail": {
                    "field": string, // optional, which parameter is invalid.
                    ... // any other information that can be useful for client
                },
            },
            ... // other errors
        ]
}

In case the request processing has been finished, the HTTP status code will be

200, and the data.status is either "success" or "failure" depending on whether the request has been successfully processed or not.

If the data.status is "failure", the "errors" field will tell you why it

failed.

error codedescription
image_too_blurthe input image is too blur
image_too_darkthe input image is too dark
image_too_brightthe input image is too bright (glare)

In case of any other errors, the data field will be empty, and the server sends one of the following HTTP status codes with an error code:

HTTP codeerror codedescription
401access_denied_exceptionYou are not authorized to perform the action.
400invalid_parameter_exceptionInput parameter violates a constraint.
400request_time_too_skewedThe X-TV-Timestamp header is expired, need a newer one.
404image_not_found_exceptionThe image ID is not found in DB.
404request_not_found_exceptionThe request ID is not found when polling result by id
408request_timeout_exceptionRequest takes too long to process
429rate_limit_exceptionThe number of requests exceeded your throughput limit.
500internal_server_errorSome unexpected error occurs while processing the request

Sample Response

JSON
{
    "data": {
        "status": "success",
        "verdict": "convicted",
        "mule_account_face_count": 4,
        "face_count": 4,
        "mule_account_flags": [
            "blacklisted",
            "convicted"
        ],
        "matched_face_counts": {
            "country": {
                "matched": true,
                "count": 4
            }
        }
    }
}