---
title: "Sandbox - Extract Async"
method: POST
path: "/ktp/id/extract-async"
tags: ["KTP"]
---

# Sandbox - Extract Async

`POST /ktp/id/extract-async`

This method helps you to recognize text in KTP image.

 The following table describes choice of image to be used as input </br>

  | Image                                      | Description                                           |
  | ------------------------------------------------|-------------------------------------------------------|
  | IMAGE_SIZE_EXCEED_LIMIT                                  | Image with size larger than 5 MB              |
  | NO_KTP_DETECTED         | Not a KTP photo            |
  | KTP                     | KTP photo       |
  | KTP_B                   | KTP photo with blur condition         |
  | KTP_D                   | KTP photo with dark condition       |
  | KTP_BD                  | KTP photo with blur and dark condition|
  |KTP_BF               |KTP photo with blur and flashlight condition|
  |KTP_F                    |KTP photo with flashlight condition|
  |KTP_G                    |KTP photo with grayscale condition|
  |KTP_FG                   |KTP photo with flashlight and grayscale condition|
  |KTP_BG                    |KTP photo with blur and grayscale condition|
  |KTP_DG               |KTP photo with dark and grayscale condition|
  
  The following table describe reference_id options to be used as an input.
  
  |reference_ID|Description|
  |-----------|---------|
  |REFERENCE_ID|Valid reference_id|
  |REFERENCE_ID_EXIST|reference_id already exist in App-ID (Not Unique)|
  |REFERENCE_ID_TOO_LONG|reference_id is too long|
  |REFERENCE_ID_TOO_SHORT|reference_id is too short|

You will receive a response of your payload request which consists of message and an error code if the request process failed. The following table is a list of error codes for the KTP extraction payload request.

| Error status                                  | Error code                    | Description                                  |
| ------------------------------|----------------------------------------------|----------------------------------------------|
| 400 | INVALID_SANDBOX_CODE              | image/reference_id not exist in image/reference_id code sandbox  |
| 400 | INVALID_PAYLOAD                | No value in payload or empty string more than 1  |
| 400 | INVALID_PAYLOAD_IMAGE_MISSING  | Image field is an empty string|
| 400 | INVALID_PAYLOAD_IMAGE_SIZE    | Image size is too big/too small |
| 400 | INVALID_PAYLOAD_IMAGE_FORMAT           | Image is unable to be decoded/retrieved from url or invalid image extension|
| 400 | INVALID_PAYLOAD_CALLBACK_URL | Callback url payload is empty/null/ not in url format (https://) |
| 400 | INVALID_PAYLOAD_REFERENCE_ID | reference_id is too short/too long |
| 400 | INVALID_PAYLOAD_REFERENCE_ID_EXISTS | reference_id already exists (not unique) |
| 500 | INTERNAL_SERVER_ERROR         | Internal server error |

## Headers

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

## Request body

- ExtractKTPAsync
  - `image` string, required — Choice of image, as given in the table
  - `validate_quality` boolean — A flag to determine whether quality validation will be executed. The validation consists of checking blur and dark with threshold.
  - `reference_id` string — Choice of reference_id, as given in the table
  - `callback_url` string — used to send recognition results to a specific url

## Response `202`

Successful Response

- ResponseExtractKTPAsync
  - `message` string, required — Message indicating the status of the request to be processed
  - `data` object — Shows the id used to pull the recognition result
    - `reference_id` string

## Other responses

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

---

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