KYC API Docs

KYC Service REST API Documentation

Compiled from the actual REST controllers inside `workspace/service/service/kycService`, covering user onboarding, liveness verification, and back-office review endpoints.

Base path/api/web/kycService
Response envelopeApiResponse { code, message, data }
Upload formatmultipart/form-data
Admin namespace/admin/kyc
Scanned Source

Integration overview derived from real controllers

This page is derived from the real routes in `ApiKycController`, `ApiKycLivenessController`, and `AdminKycController` instead of a generic marketing outline.

01

Create the profile

Call `/submit` first to obtain the `profileId` used by document upload, liveness, and status queries.

02

Send document data

If you already host the files, use `/document`; the recommended path is `/document/upload` for image upload, OCR, and quality checks.

03

Confirm and submit

Use `/document/confirm` so the user can verify extracted fields, then `/document/submit` to route the record to auto-approval or manual review.

04

Run liveness and poll status

The liveness flow uses `/liveness/start` and `/liveness/verify`, while `/status/{profileId}` returns the overall KYC result.

Scanned source: /workspace/service/service/kycService/src/main/java/com/sargia/finger/kycService/rest

The service also contains mirrored admin-style endpoints at `/api/web/kycService/list`, `/detail/{profileId}`, and `/status/update`, while the dedicated back-office namespace remains `/admin/kyc`.

Envelope

Shared response structure

Every scanned controller returns `ApiResponse`, with business payloads nested inside `data`.

FieldTypeExample
codenumber0 for success, non-zero for failures or business exceptions
messagestringsuccess, query success, Document uploaded successfully, and similar messages
dataobjectBusiness payload such as profileId, status, detail, or list
Core Web API

User-facing endpoints

Mapped from `ApiKycController`, covering profile creation, document upload, field confirmation, submission, and status queries.

7 documented endpoints
POST/api/web/kycService/submit
Selected endpoint

Create profile

Create a KYC profile and return the `profileId` used by all downstream calls.

PublicRecommended
FieldTypeRequiredLocationExample
userIdstringYesbodyuser_10001
countrystringYesbodySG

Response highlights

profileId

Notes

  • Returns `ApiResponse.ok().data("profileId", profileId)` on success.
POST/api/web/kycService/document
Selected endpoint

Upload document metadata

Submit document metadata with image URLs or base64 references for teams that already host files.

Public
FieldTypeRequiredLocationExample
profileIdstringYesbodyprofile_123456
docTypestringYesbodyPASSPORT
docNumberstringNobodyE12345678
frontImageUrlstringYesbodyhttps://cdn.example/front.jpg
backImageUrlstringNobodyhttps://cdn.example/back.jpg
expiryDatedateNobody2030-12-31
issueCountrystringNobodySG

Response highlights

codemessage

Notes

  • The controller stores document metadata through `kycService.uploadDocument(...)`.
POST/api/web/kycService/document/upload
Selected endpoint

Upload and verify document

Upload front and back images, run OCR and quality checks, and return extracted identity fields.

PublicRecommended
FieldTypeRequiredLocationExample
profileIdstringYesmultipartprofile_123456
docTypestringYesmultipartID_CARD
countrystringYesmultipartSG
frontImagefileYesmultipartid-front.jpg
backImagefileNomultipartid-back.jpg

Response highlights

documentIdverifiednameidNumberbirthDateexpiryDatefrontQualityScorebackQualityScoreerrors

Notes

  • When OCR succeeds, the response includes extracted identity fields for user confirmation.
  • When verification fails, the controller returns `errorCode`, quality scores, and `errors`.
POST/api/web/kycService/document/confirm
Selected endpoint

Confirm extracted fields

Let the user confirm or edit OCR results before the final review step.

Public
FieldTypeRequiredLocationExample
documentIdnumberYesquery123456789
namestringNobodyAlex Tan
idNumberstringNobodyS1234567A
birthDatedateNobody1990-01-01
expiryDatedateNobody2030-12-31
issuerstringNobodyICA Singapore
nationalitystringNobodySGP
userModifiedbooleanNobodytrue

Response highlights

documentIdstatusverifiedextractedInfo

Notes

  • If `userModified` is true, the service message indicates the record will enter manual review.
POST/api/web/kycService/document/submit
Selected endpoint

Submit document for review

Finalize the document step after user confirmation and return the review status.

Public
FieldTypeRequiredLocationExample
documentIdnumberYesquery123456789

Response highlights

documentIdstatusverifiederrors

Notes

  • The controller maps status 1, 2, and 3 to auto-approved, manual review, and user-modified review.
GET/api/web/kycService/status/{profileId}
Selected endpoint

Get verification status

Fetch the current KYC status, liveness result, and face-match information by `profileId`.

PublicRecommended
FieldTypeRequiredLocationExample
profileIdstringYespathprofile_123456

Response highlights

statusstatusDescriptionkycLevelriskScorelivenessStatusfaceMatchPassed

Notes

  • Returns `data.status` as a `KycStatusDto` object rather than a flat primitive field.
POST/api/web/kycService/callback/liveness
Selected endpoint

Liveness callback

Server-to-server callback used to persist liveness results rather than a browser-facing endpoint.

Callback
FieldTypeRequiredLocationExample
profileIdstringYesbodyprofile_123456
sessionIdstringNobody550e8400-e29b-41d4-a716-446655440000
confidencenumberNobody96.2
resultstringNobodysuccess
errorMessagestringNobodytimeout

Response highlights

codemessage

Notes

  • `LivenessCallback.toEntity()` is currently a placeholder conversion in the scanned service code.
Liveness API

Liveness verification endpoints

Mapped from `ApiKycLivenessController`, including session creation, video verification, and session lookup.

3 documented endpoints
POST/api/web/kycService/liveness/start
Selected endpoint

Start liveness session

Create a five-minute session and return three randomized challenge actions.

PublicRecommended
FieldTypeRequiredLocationExample
profileIdstringYesqueryprofile_123456

Response highlights

sessionIdactionsexpireTimetimeout

Notes

  • The controller shuffles `LivenessActionEnum` values and returns exactly three actions.
POST/api/web/kycService/liveness/verify
Selected endpoint

Verify liveness videos

Upload three challenge videos and return the aggregated liveness result.

PublicRecommended
FieldTypeRequiredLocationExample
sessionIdstringYesmultipart550e8400-e29b-41d4-a716-446655440000
profileIdstringYesmultipartprofile_123456
video1fileYesmultipartblink.mp4
video2fileYesmultipartsmile.mp4
video3fileYesmultipartturn-left.mp4

Response highlights

verifiedconfidencecompletedActionsfailedActionsmessage

Notes

  • Failure uses `ApiResponse.error().code(20001)` with the liveness result still returned in `data.list`.
GET/api/web/kycService/liveness/session/{sessionId}
Selected endpoint

Get liveness session

Read the current liveness session from cache and inspect its status.

Public
FieldTypeRequiredLocationExample
sessionIdstringYespath550e8400-e29b-41d4-a716-446655440000

Response highlights

sessionIdprofileIdactionsexpireTimestatuscreateTime

Notes

  • If the session is missing or expired, the controller returns an error message instead of null data.
Admin Review API

Back-office review endpoints

Mapped from `AdminKycController`, including list, detail, and review status updates.

3 documented endpoints
POST/admin/kyc/list
Selected endpoint

List KYC records

Query paginated KYC records for operations teams and filter by `profileIds` when needed.

Admin
FieldTypeRequiredLocationExample
profileIdsarray<string>Nobody["profile_123","profile_456"]
pagenumberNobody1
limitnumberNobody20

Response highlights

totalpagescurrentsizerecords

Notes

  • The same list capability is also mirrored in `ApiKycController` at `/api/web/kycService/list`.
GET/admin/kyc/detail/{profileId}
Selected endpoint

Get KYC detail

Fetch the full review payload for one profile, including document, liveness, and face-match data.

Admin
FieldTypeRequiredLocationExample
profileIdstringYespathprofile_123456

Response highlights

detail

Notes

  • A mirrored detail endpoint also exists at `/api/web/kycService/detail/{profileId}`.
POST/admin/kyc/update-status
Selected endpoint

Update review status

Approve, reject, or reset the KYC review state from the admin namespace.

Admin
FieldTypeRequiredLocationExample
profileIdstringYesbodyprofile_123456
statusstringYesbody2
remarkstringNobodyManual review passed

Response highlights

codemessage

Notes

  • Allowed status values in the DTO are `-1`, `0`, and `2`.
  • The web-controller mirror path is `/api/web/kycService/status/update`.