API Docs · eKYC Core

Common objects

Two shapes recur across the eKYC Core surface: the ImageData object every image-taking endpoint accepts, and the envelope its JSON responses are wrapped in. They are defined here once and referred to by name from each endpoint page.

The three lookup tables — Image label table, Card type table and Response errors — stay on the Overview, because they are read alongside the authentication and usage rules rather than alongside a single object.

ImageData

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.

Wherever an endpoint's Request table types a parameter ImageDataimage, image1, image2, or an array of them such as selfies, images or qr1_images — this is the object it takes.

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}"

Each key is optional on its own, but the two ways of naming an image are mutually exclusive:

  • If you use base64, label and metadata, omit parameter id.
  • If you use id (result id is returned from Upload Image API), omit parameter base64, label and metadata.

A few endpoints accept one further key on the same object — an embedding, for instance. Where they do, the endpoint's own Request section carries the extra row and the note that goes with it.

Response envelope

Where an endpoint answers in JSON, the body carries two top-level keys. data holds the result, and its fields differ from endpoint to endpoint, so each endpoint page documents its own. errors carries the same three keys on every endpoint and is defined below.

JSON
{
    "data": {
        "status": string, // "success" or "failure"
        ...
    },
    "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, with a code belonging to that endpoint — those are listed under Failure codes on the endpoint's own page.

Each entry in errors carries:

NameTypeDescription
codestringwhich error occurred — see Response errors, or Failure codes on the endpoint's page
messagestringthe message that accompanies the code
detailobjectfield is optional and says which parameter is invalid, plus any other information that can be useful for client

In case of any other errors, the data field will be empty, and the server sends one of following HTTP status code with error code. Response errors on the Overview lists those for the eKYC Core surface as a whole; each endpoint page carries the list documented for that endpoint under Failure codes, and the two do not match on every endpoint.

The download endpoints are the exception to the shape above. On success they send the file itself as binary content, so they use this envelope only to report an error — and then data is {}. See Download image and Download file.

All failure codes, by endpoint

Every eKYC Core endpoint documents its own Failure codes section — repeated per endpoint rather than deduplicated, because the sets genuinely differ: request_not_found_exception is documented on only 16 of the 36 endpoints below, Face OTP both drops and adds codes the rest share, and the file endpoints redefine what 413/415 mean. This table is an index over those pages, not a replacement for them — each row names every endpoint that documents a given HTTP code, error code and description exactly as its own page has it. Get result is the one endpoint of the 37 with no Failure codes section at all.

HTTP codeError codeDescriptionWhere
400incorrect_number_of_facesSelfie or original image have more than 1 faces.Only Face OTP.
400invalid_parameter_exceptionInput parameter violates a constraint.All except Get client settings, Delete files.
400request_time_too_skewedThe X-TV-Timestamp header is expired, need a newer one.All except Get client settings, Get requests by X-Request-ID, Face OTP, Delete files, Update metadata.
401access_denied_exceptionYou are not authorized to perform the action.All except Create temporary credential.
404image_not_found_exceptionThe image ID is not found in DB.All except Create temporary credential, Get client settings, Get requests by X-Request-ID, Delete files, Check NFC, Verify NFC, Create a transaction, Finish a transaction.
404image_not_found_exceptionThe image ID of id_card is not foundOnly Verify NFC — its own wording for the same code.
404request_not_found_exceptionThe request ID is not found when polling result by idOnly Full eKYC, Alert faces, Compare faces, Detect faces, Index faces, Index faces video, Search faces, Verify faces suspicious, Detect ID cards, Read doc info, Read ID card info, Read QR info, Verify identity, Search metadata, Check NFC, Verify NFC.
404request_not_found_exceptionThe request ID is not found in Memory Cache and DB.Only Face OTP — its own wording for the same code.
405not_allow_delete_exceptionNot allow to delete fileOnly Delete files.
408request_timeout_exceptionRequest takes too long to processAll except Get requests by X-Request-ID.
413file_too_large_exceptionThe input file size exceeds the allowed limit (15MB).Only Convert PDF to images, Upload video/audio/frames.
413image_too_large_exceptionThe input image size exceeds the allowed limit (15MB).Only Verify face liveness, Verify face video liveness, Upload image, Vision Score.
415invalid_file_format_exceptionThe provided file format is not supported (PDF).Only Convert PDF to images.
415invalid_image_format_exceptionThe provided image format is not supported (JPG/PNG)Only Verify face liveness, Verify face video liveness, Upload image, Vision Score.
429rate_limit_exceptionThe number of requests exceeded your throughput limit.All except Get requests by X-Request-ID.
500internal_server_errorSome unexpected error occurs while processing the requestEvery endpoint with a Failure codes section.

This table covers the HTTP-status transport codes only — the endpoint-specific business codes (image_has_no_faces, incorrect_card_type, and the rest of the data.status: "failure" codes a handful of endpoints define) stay on each endpoint's own Failure codes section, since they only make sense in that endpoint's context.