---
title: "ID Forgery"
method: POST
path: "/v2/ktp/idforgery"
tags: ["ID Forgery"]
---

# ID Forgery

`POST /v2/ktp/idforgery`

This method helps you to to detect if an ID is real or fake. 
<br>
You will receive a response consists of message and an error code if the request fails to process. The following is a list of error codes. </br>

| Error status                    | Error code          | Description                                  |
|-----------------------------|---------------------------------------------|---------------------------------------------|
|200   | FAIL_ON_1                      | fail on quality                          |
|200   | FAIL_ON_2                      | forgery detected                         |
| 400  | INVALID_PAYLOAD                | no value in payload or empty string more than 1  |
|400   | INVALID_PAYLOAD_IMAGE_MISSING  | invalid payload image not a standard b64/url or image empty string | 
|400   | MISSING_PAYLOAD_IMAGE         |  missing payload image                       |
|400   | INVALID_PAYLOAD_IMAGE_TIMEOUT  | timeout getting image from url in 15 seconds                |
|400   | INVALID_PAYLOAD_IMAGE_FORMAT   | image unable to be decoded/got from url OR invalid image extension |
|400   | INVALID_PAYLOAD_QUALITY_VALIDATION_DEPENDENCY  | is_quality must be true if validate_quality true |
|403   | INSUFFICIENT_QUOTA     | usage reach it quota limit for ID Forgery |
|500   | INTERNAL_SERVER_ERROR         | internal server error | <br>

## Headers

- `App-ID` string, required
- `API-Key` string, required

## Request body

- IDForgery
  - `image` string, required — A base64 or URL image file.
  - `is_quality` boolean — A flag to determine whether Image Quality (blur, dark, grayscale, and flashlight) will be computed and return as result
  - `validate_quality` boolean — Determines whether Quality validation will be executed. The validation consists of checking blur and dark with threshold, and also checking whether the image interrupted by flashlight or detected as graysacale image. When is_liveness is set to true, it is best that validate_quality is set to true, as liveness is influenced by Quality.

## Response `200`

Successful Response

- ResponseIDForgery
  - `Message` string — Message indicating the status of the request to be processed
  - `error_code` string — This error_code indicates an error that appeared in processing the request from the ID Forgery method
  - `image_forgery` boolean — shows if the ID from uploaded image is detected as forgery
  - `image_quality` object — Shows quality of image
    - `blur` boolean
    - `dark` boolean
    - `flashlight` boolean
    - `grayscale` boolean

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `500` — Internal Server Error

---

[API](https://skmtc.dev/verihubs/apis/sms-api-documentation.md) · [All operations](https://skmtc.dev/verihubs/apis/sms-api-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/verihubs/sms-api-documentation/revisions/5fa885d38adc/schema)
