For the complete documentation index, see llms.txt. This page is also available as Markdown.

Asset upload

DAF does not receive files directly: it consumes the assets already loaded in the Facephi storage service, referenced by their fileKey. Before starting a validation, upload each asset (document and, optionally, selfie) with the storage Endpoint.

Endpoint

POST /storage

Headers

Name
Type
Required
Description

Authorization

string

Yes

consumer Token in format Bearer <token> (see Authentication).

consumer-id

string

Yes

Consumer identifier.

Request body

Content-Type: application/json

Parameters

Parameter
Type
Required
Description

operationId

string

Yes

Identifier of the operation to which the asset belongs.

asset

object

Yes

Asset to save.

asset.context

string

Yes

Type of asset (see the table of types below).

asset.file

string

Yes

Asset content (document or selfie Token), encoded in Base64. For TOKEN_FRONT_DOCUMENT and TOKEN_BACK_DOCUMENT must be the RAW Token of the document generated by the capture SDK.

Request example

{
  "operationId": "<operationId>",
  "asset": {
    "context": "TOKEN_FRONT_DOCUMENT",
    "file": "<base64>"
  }
}

Responses

200 Success

Response parameters

Parameter
Type
Description

fileKey

string

Asset key in the form <consumerId>/<operationId>.

timestamp

string

Response timestamp in format ISO 8601.

Response example

409 Conflict

An asset of the same type already exists for that operationId. There cannot be more than one asset of the same type for the same operationId.

Asset types relevant to DAF

type
Content
Requiredness

TOKEN_FRONT_DOCUMENT

RAW Token of the front side of the Identity document (e.g. tokenRawFrontDocument generated by the capture SDK).

Required

TOKEN_BACK_DOCUMENT

RAW Token of the back side of the Identity document (e.g. tokenRawBackDocument generated by the capture SDK).

Optional

TOKEN_FACE_IMAGE

Selfie of the holder.

Optional

If it is not provided TOKEN_FACE_IMAGE, DAF validates only the document: the signals derived from the selfie (facial comparison) are lost and the diagnosis is based only on the document validations.

Supported documents

  • DAF validates identity documents (ID) and passports.

  • For passports, the back side is not required: the front side is enough (TOKEN_FRONT_DOCUMENT).

  • The specific set of supported document types and countries/issuers is defined in the service registration; check it with Facephi for your Integration.

  • If the document is not supported or its Version cannot be validated, the transaction is resolved as DECLINED with the corresponding reason code (see Result response).

Requirements and image quality

Capture quality determines whether the document can be validated. To maximize the approval rate:

  • Resolution recommended minimum: HD (≥ 720×1080 px).

  • Size maximum per file: 10 MB. Avoid aggressive compression; use the default values of a guided capture Flow.

  • Framing: the document must appear complete and without cropping, occupying most of the frame and with a standard card aspect ratio.

  • Sharpness and lighting: without blur, without reflections or glare that hide data, and without excessive rotation.

  • There cannot be more than one asset of the same type for the same operationId (a second upload of the same type returns 409 Conflict).

If a capture does not meet these requirements, validation flags it as a quality/capture issue (not as fraud): these are the codes of the categories input and integrity (e.g. 100/101/104/105 and 102/103/106-111/500/501, see Result response). In these cases, repeating the capture with better quality usually resolves the issue.

Last updated