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.
| Name | Type | Required | Description |
|---|---|---|---|
id | string | Optional | ID of image is returned from API Upload |
base64 | string | Optional | base64 encoded text of image data |
label | string | Optional | label of the image as described at Label table |
metadata | string_json | Optional | key-value string, key should be string, value should be string, int, float, bool. Example "{\"id\":\"123456789\",\"type\":1}" |
embedding | []float | Optional | Vector embedding of the face in the image. |
- If you use
id, omitbase64,label,metadata, andembedding. - If you use
base64, you can also includelabelandmetadata. Omitidandembedding. - If you use
embedding, omit all other image parameters. - The priority order for processing is:
id, thenbase64, thenembedding.
account_identifier
Contains info about the account holder's identity. Both endpoints take one, in account_identifier.
| Name | Type | Required | Description |
|---|---|---|---|
national_id | string | Optional | National identification number. |
identifier_type | string | Optional | Type of the identification document. |
country | string | Optional | Country that issued the ID, in ISO 3166-1 alpha-2 format (e.g., "vn"). |
dob | string | Optional | Date of birth in YYYY-MM-DD format. |
first_name | string | Optional | First name of the account holder. |
last_name | string | Optional | Last name of the account holder. |
middle_name | string | Optional | Middle name of the account holder. |
metadata | JSON | Optional | Additional 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 code | Error code | Description |
|---|---|---|
401 | access_denied_exception | You are not authorized to perform the action. |
400 | invalid_parameter_exception | Input parameter violates a constraint. |
400 | request_time_too_skewed | The X-TV-Timestamp header is expired, need a newer one. |
404 | image_not_found_exception | The image ID is not found in DB. |
404 | request_not_found_exception | The request ID is not found when polling result by id |
408 | request_timeout_exception | Request takes too long to process |
429 | rate_limit_exception | The number of requests exceeded your throughput limit. |
500 | internal_server_error | Some unexpected error occurs while processing the request |