RS-ID Backend API is a server-to-server integration. Your backend sends face photos directly to RS-ID and gets back the comparison result. Citizen data is checked against the national identity registry of Uzbekistan when needed.
Without info. In this integration RS-ID returns only the comparison result — the similarity score and the failure reason. The citizen's personal details (name, document, address) are not returned after identification.
There is no RS-ID page or SDK. You take the photos in your own app or site, and your backend calls RS-ID:
1.
optionally checks that each photo is a live person, not a photo, screen or mask (anti-spoofing);
2.
compares the faces: either the user's photo with their passport photo from the government registry, or two photos you send;
3.
returns the similarity score and the failure reason, if any. No citizen personal details are returned.
Choose the option that matches what you need to compare. All three are asynchronous and return a session_id; the result is always taken with 7.6 Get result.
Option
Endpoint
What is compared
user_info
Option 1
POST /v1/authentication/async/compare
One user photo ↔ the citizen's passport photo from the registry
Required
Option 2
POST /v1/authentication/async/compare-images
Two photos sent by the client
Required
Option 3
POST /v1/face/async/compare-images
Two photos sent by the client
Not used
Common flow:
1.
Your backend signs in (7.1).
2.
It calls one of the options (7.3–7.5).
3.
If the result is ready within 3 seconds, the response has code = 0. Otherwise it has code = -200 (still processing). Both responses carry the session_id in data.
4.
Your backend gets the result with GET /v1/user/{session_id} (7.6).
Stage and production use different client_id / client_secret. Backend API credentials are separate from Web and Mobile SDK credentials — an SDK client cannot call the compare endpoints (-1002).
Idempotency-Key. Generate a new UUID for every compare request. If you repeat a request with the same key within 5 minutes, RS-ID returns the saved response of the first request instead of running a new comparison — useful for safe retries after a network error. A repeat while the first request is still running returns HTTP 409. A missing key returns HTTP 400.
Exchanges client credentials for an access token.Method - POST Endpoint - {base_url}/v1/auth/sign-in — no Authorization header Content-Type (Headers) - application/json Request body
Gets a new access_token with the refresh_token, without sending a new sign-in. Call it when the access_token has expired (after expires_in seconds).Method - POST Endpoint - {base_url}/v1/auth/refresh?token={refresh_token} — no Authorization header. Content-Type (Headers) - application/json Query parameters
Field
Type
Required
Length / format
Description
token
string
Yes
JWT
refresh_token from the sign-in (7.1) or a previous refresh response.
If the refresh token is expired or invalid, sign in again (7.1).
7.3 Option 1 — Compare a photo with the passport photo#
Compares one user photo with the citizen's passport photo from the government registry. RS-ID finds the citizen by user_info, takes their passport photo and data, and compares the faces.Method - POST Endpoint - {base_url}/v1/authentication/async/compare Authorization (Headers) - Bearer {access_token} Idempotency-Key (Headers) - {uuid} Content-Type (Headers) - application/json Request body
Field
Type
Required
Length / format
Description
photo
string
Yes
Base64
The user's photo (selfie).
is_spoofing_required
boolean
No
true / false
Run the liveness (anti-spoofing) check on the photo. Default false. Recommended true for live selfies.
user_info
object
Yes
—
Citizen data used to find the passport photo.
user_info.pinfl
string
Conditional
Exactly 14 digits
PINFL. Send eitherpinflorid_number, not both.
user_info.id_number
string
Conditional
9 chars: 2 letters + 7 digits, e.g. AA1234567
Passport / ID card number. Send eitherpinflorid_number, not both.
user_info.birth_date
string
Yes, if user_info is sent
dd.MM.yyyy
Date of birth. User must be at least 16 years old.
threshold
number
No
0.0 – 1.0
Minimum face-similarity score to pass. Default 0.5. See the note below.
external_id
string
No
—
Your own reference to link the request to your records. Recommended random uuid.
locale
string (enum)
No
UZ, RU, EN
Default UZ.
Threshold.threshold is the minimum face-similarity score (from 0.0 to 1.0) for the comparison to pass. If you don't send it, the default 0.5 is used. If you do send it, we recommend a value above 0.5. For high-quality (strict) identification, send a value above 0.7. A higher value is stricter and lowers the risk of a wrong person passing, but genuine users may fail more often.
Still processing (the result will be available in 7.6):
{"data":"7c9e6679-7425-40de-944b-e07fc1f90ae7","code":-200,"message":"Waiting for async process"}
The response is not the verdict.code = 0 means the comparison has finished, not that the faces matched or the photo is live. Always read the result with 7.6 and check comparison_value and note.
Errors
Code
Reason
-1000
Invalid request — e.g. no user_info, or both / neither of pinfl / id_number; citizen not found in the registry.
-1002
Credentials do not belong to a Backend API client.
-1024
Invalid id_number format.
-1025
Invalid pinfl format.
-1026
birth_date is missing.
-1052
threshold outside 0–1.
-1090
User is younger than 16.
-2001
Face service error.
400
Field validation error (e.g. photo cannot be blank), or Idempotency-Key header missing.
409 (HTTP)
A request with the same Idempotency-Key is still being processed.
7.4 Option 2 — Compare two photos with citizen data#
Compares two photos sent by the client with each other. The citizen is identified by user_info.Method - POST Endpoint - {base_url}/v1/authentication/async/compare-images Authorization (Headers) - Bearer {access_token} Idempotency-Key (Headers) - {uuid} Content-Type (Headers) - application/json Request body
Field
Type
Required
Length / format
Description
original_photo
object
Yes
—
The first photo, e.g. the user's live selfie.
original_photo.photo
string
Yes
Base64
Photo data.
original_photo.is_spoofing_required
boolean
No
true / false
Run the liveness check on this photo. Default false. Recommended true for a live selfie.
original_photo.order
integer
No
—
Order of the photo.
reference_photo
object
Yes
—
The second photo to compare with, e.g. a document photo or a saved selfie.
reference_photo.photo
string
Yes
Base64
Photo data.
reference_photo.is_spoofing_required
boolean
No
true / false
Run the liveness check on this photo. Default false. Keep false for document photos.
reference_photo.order
integer
No
—
Order of the photo.
user_info
object
Yes
—
Citizen data. Same rules as in 7.3.
user_info.pinfl
string
Conditional
Exactly 14 digits
PINFL. Send eitherpinflorid_number.
user_info.id_number
string
Conditional
9 chars: 2 letters + 7 digits
Passport / ID card number.
user_info.birth_date
string
Yes, if user_info is sent
dd.MM.yyyy
Date of birth. User must be at least 16.
threshold
number
No
0.0 – 1.0
Default 0.5. Recommended above 0.5, above 0.7 for strict comparison.
original_photo or reference_photo missing (original photo should be exist, reference photo should be exist).
7.5 Option 3 — Compare two photos without citizen data#
Compares two photos sent by the client without any citizen data. No registry lookup is made.Method - POST Endpoint - {base_url}/v1/face/async/compare-images Authorization (Headers) - Bearer {access_token} Idempotency-Key (Headers) - {uuid} Content-Type (Headers) - application/json Request body
Field
Type
Required
Length / format
Description
original_photo
object
Yes
—
The first photo.
original_photo.photo
string
Yes
Base64
Photo data.
original_photo.is_spoofing_required
boolean
No
true / false
Run the liveness check on this photo. Default false.
original_photo.order
integer
No
—
Order of the photo.
reference_photo
object
Yes
—
The second photo.
reference_photo.photo
string
Yes
Base64
Photo data.
reference_photo.is_spoofing_required
boolean
No
true / false
Run the liveness check on this photo. Default false.
reference_photo.order
integer
No
—
Order of the photo.
threshold
number
No
0.0 – 1.0
Default 0.5. Recommended above 0.5, above 0.7 for strict comparison.
The client backend gets the result of a comparison by its session_id — for all three options. The result contains only session_id, comparison_value and note; citizen personal details are not returned.Method - GET Endpoint - {base_url}/v1/user/{session_id} Authorization (Headers) - Bearer {access_token} Path parameters
Field
Type
Required
Length / format
Description
session_id
string
Yes
UUID, 36 chars
data from the compare response (7.3–7.5).
How to read the result
Field
Meaning
comparison_value
Face-similarity score, 0–1. Compare it with your threshold.
note
Empty on a clean pass. Contains the reason otherwise — e.g. Spoofed file detected (liveness failed) or Face match failed (score below threshold).
Pass rule. Treat the check as passed only when comparison_value ≥ your thresholdandnote is empty. With is_spoofing_required: true, a spoofed photo does not return an error from the compare endpoint — it is reported here in note.