Mule Account Database

Common objects & errors

Both Mule Account Database endpoints take the same request body — an image and an account_identifier — and they fail the same way at the transport layer. All of it is defined once, here, and referred to by name from each endpoint page.

Request objects

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.

image

Image of the identity card's front side. Report an account and Search for an account each take one, in image.

NameTypeRequiredDescription
idstringOptionalID of image is returned from API Upload
base64stringOptionalbase64 encoded text of image data
labelstringOptionallabel of the image as described at Label table
metadatastring_jsonOptionalkey-value string, key should be string, value should be string, int, float, bool. Example "{\"id\":\"123456789\",\"type\":1}"
embedding[]floatOptionalVector embedding of the face in the image.
  • 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.

account_identifier

Contains info about the account holder's identity. Both endpoints take one, in account_identifier.

NameTypeRequiredDescription
national_idstringOptionalNational identification number.
identifier_typestringOptionalType of the identification document.
countrystringOptionalCountry that issued the ID, in ISO 3166-1 alpha-2 format (e.g., "vn").
dobstringOptionalDate of birth in YYYY-MM-DD format.
first_namestringOptionalFirst name of the account holder.
last_namestringOptionalLast name of the account holder.
middle_namestringOptionalMiddle name of the account holder.
metadataJSONOptionalAdditional key-value data.

Report an account also documents a flag field on this object. Search for an account does not.

Errors

Every response carries an errors array alongside data. Each entry has a code, a message and a detail object, in which field is optional and says which parameter is invalid, alongside any other information that can be useful for client. The shape is written out in the response block on each endpoint page.

The codes that arrive with HTTP 200 and data.status: "failure" are listed under Failure codes on the endpoint that returned them.

Shared transport errors

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. These are the same on both calls.

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