Background supergraphic

KITAS/KITAP beta

KITAS (Kartu Izin Tinggal Terbatas) and KITAP (Kartu Izin Tinggal Tetap) are residence permits issued in Indonesia for foreign nationals.

KITAS/KITAP Object

  • Name
    status
    Type
    string
    Description

    Enum code indicating the status of the reading result.

    1. SUCCESS
    2. NO_FILE
    3. FILE_INVALID_FORMAT
    4. FAILED
  • Name
    reason
    Type
    string
    Description

    A human-readable message providing more details about the reading result.

  • Name
    read
    Type
    object
    Description

    Contains the reading for each KITAS/KITAP fields. Each field contains:

    • confidence_text (number): Text recognition confidence in percentage (except photo and sign field)
    • confidence (number): Overall confidence score in percentage
    • polygon (array): Array of coordinate pairs [x, y] representing the bounding box of the field
    • value_original (string): The original text as read from the document (except photo and sign field)
    • value (string): The processed/extracted value
    • page_index (number): Page number where the field was found (0-indexed)
    • Name
      photo
      Type
      object
      Description

      Photo in base64 format.

    • Name
      sign
      Type
      string
      Description

      Signature in base64 format (if available).

    • Name
      address
      Type
      object
      Description

      Address of residence in Indonesia.

    • Name
      date_of_birth
      Type
      object
      Description

      Date of birth in dd-mm-yyyy format.

    • Name
      document_type
      Type
      object
      Description

      Type of document (KITAS or KITAP).

    • Name
      full_name
      Type
      object
      Description

      Full name of the holder.

    • Name
      gender
      Type
      object
      Description

      Gender (M for Male, F for Female).

    • Name
      guarantor_name
      Type
      object
      Description

      Name of the guarantor (if applicable).

    • Name
      issued_date
      Type
      object
      Description

      Date when the permit was issued in dd-mm-yyyy format.

    • Name
      issued_place
      Type
      object
      Description

      Place where the permit was issued.

    • Name
      nationality
      Type
      object
      Description

      Nationality of the holder.

    • Name
      niora
      Type
      object
      Description

      NIORA (Nomor Induk Orang Asing) - Foreigner Identification Number.

    • Name
      occupation
      Type
      object
      Description

      Occupation or job title.

    • Name
      office_address
      Type
      object
      Description

      Address of the immigration office that issued the permit.

    • Name
      office_name
      Type
      object
      Description

      Name of the immigration office that issued the permit.

    • Name
      office_region
      Type
      object
      Description

      Region of the immigration office.

    • Name
      passport_expiry
      Type
      object
      Description

      Passport expiry date in dd-mm-yyyy format.

    • Name
      passport_number
      Type
      object
      Description

      Passport number.

    • Name
      permit_number
      Type
      object
      Description

      KITAS/KITAP permit number.

    • Name
      place_of_birth
      Type
      object
      Description

      Place of birth.

    • Name
      status
      Type
      object
      Description

      Status of the permit (e.g., FAMILY UNION, WORK PERMIT, etc.).

    • Name
      stay_entries_permit_expiry
      Type
      object
      Description

      Single entry permit expiry date in dd-mm-yyyy format (if applicable).

    • Name
      stay_multiple_entries_permit_expiry
      Type
      object
      Description

      Multiple entry permit expiry date in dd-mm-yyyy format (if applicable).

    • Name
      stay_permit_index
      Type
      object
      Description

      Stay permit index number (if applicable).


POST/ocr/v1/kitas-kitap

Read KITAS/KITAP

Detects a valid KITAS/KITAP image and returns the information extracted from the document.

Required parameter

  • Name
    image
    Type
    file (.png, .jpg, .jpeg, .pdf)
    Description

    The image file for the KITAS/KITAP document.

Sample Request

POST
/ocr/v1/kitas-kitap
1
2
3
4
curl -v -L -X POST 'https://api.vision.glair.ai/ocr/v1/kitas-kitap' \ -H "Authorization: Basic $(printf "%s" "USERNAME:PASSWORD" | base64)" \ -H 'x-api-key: API_KEY' \ -F 'image=@"/path/to/image/KITAS-KITAP.jpg"'

Sample Response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
{ "status": "SUCCESS", "reason": "File Successfully Read", "read": { "office_region": { "value": "KANTOR WILAYAH BANGKA BELITUNG", "value_original": "KANTOR WILAYAH BANGKA BELITUNG", "confidence": 0.9188, "confidence_text": 0.9964, "polygon": [ [275, 120], [659, 120], [659, 140], [275, 140] ], "page_index": 0 }, "office_name": { "value": "KANIM KELAS I TPI PANGKAL PINANG", "value_original": "KANIM KELAS I TPI PANGKAL PINANG", "confidence": 0.9212, "confidence_text": 0.9773, "polygon": [ [270, 139], [659, 139], [659, 158], [270, 158] ], "page_index": 0 }, "office_address": { "value": "JL. JEND. SUDIRMAN KM. 3 SELINDUNG BARU", "value_original": "JL. JEND. SUDIRMAN KM. 3 SELINDUNG BARU", "confidence": 0.942, "confidence_text": 0.9973, "polygon": [ [245, 178], [245, 157], [681, 157], [681, 178] ], "page_index": 0 }, "document_type": { "value": "IZIN TINGGAL TERBATAS ELEKTRONIK", "value_original": "IZIN TINGGAL TERBATAS ELEKTRONIK", "confidence": 0.9288, "confidence_text": 0.9871, "polygon": [ [241, 222], [671, 222], [671, 246], [241, 246] ], "page_index": 0 }, "photo": { "value": "iVBO...", "confidence": 0.9745, "polygon": [ [93, 280], [219, 280], [219, 440], [93, 440] ], "page_index": 0 }, "permit_number": { "value": "2C21HB0016AT", "value_original": "2C21HB0016AT", "confidence": 0.8927, "confidence_text": 0.9995, "polygon": [ [538, 361], [538, 342], [660, 342], [660, 361] ], "page_index": 0 }, "stay_permit_index": { "value": "VIB", "value_original": "VI B", "confidence": 0.8674, "confidence_text": 0.9285, "polygon": [ [540, 406], [580, 406], [580, 424], [540, 424] ], "page_index": 0 }, "stay_multiple_entries_permit_expiry": { "value": "11-07-2020", "value_original": "11-07-2020", "confidence": 0.8938, "confidence_text": 1.0, "polygon": [ [541, 376], [625, 376], [625, 394], [541, 394] ], "page_index": 0 }, "niora": { "value": "3ATAA20536", "value_original": "3ATAA20536", "confidence": 0.8801, "confidence_text": 0.9997, "polygon": [ [541, 312], [643, 312], [643, 327], [541, 327] ], "page_index": 0 }, "full_name": { "value": "YOUXING CHEN", "value_original": "YOUXING CHEN", "confidence": 0.9087, "confidence_text": 0.9998, "polygon": [ [277, 501], [422, 501], [422, 522], [277, 522] ], "page_index": 0 }, "place_of_birth": { "value": "FUJIAN", "value_original": "FUJIAN", "confidence": 0.9102, "confidence_text": 0.9999, "polygon": [ [276, 527], [345, 527], [345, 548], [276, 548] ], "page_index": 0 }, "date_of_birth": { "value": "20-01-1979", "value_original": "20-01-1979", "confidence": 0.9141, "confidence_text": 0.9544, "polygon": [ [354, 527], [445, 527], [445, 548], [354, 548] ], "page_index": 0 }, "passport_number": { "value": "G59337358", "value_original": "G59337358", "confidence": 0.9224, "confidence_text": 0.9992, "polygon": [ [277, 559], [370, 559], [370, 574], [277, 574] ], "page_index": 0 }, "passport_expiry": { "value": "07-03-2022", "value_original": "07-03-2022", "confidence": 0.8963, "confidence_text": 1.0, "polygon": [ [276, 580], [369, 580], [369, 596], [276, 596] ], "page_index": 0 }, "nationality": { "value": "CHINA", "value_original": "CHINA", "confidence": 0.8254, "confidence_text": 0.9987, "polygon": [ [276, 605], [341, 605], [341, 626], [276, 626] ], "page_index": 0 }, "gender": { "value": "M", "value_original": "MALE", "confidence": 0.9245, "confidence_text": 1.0, "polygon": [ [275, 632], [337, 632], [337, 652], [275, 652] ], "page_index": 0 }, "address": { "value": "JL. RAYA SUNGAILIAT PANGKALPINANG KM.10 MERAWANG BANGKA", "value_original": "JL. RAYA SUNGAILIAT PANGKALPINANG KM.10 MERAWANG BANGKA", "confidence": 0.88, "confidence_text": 0.9926, "polygon": [ [275, 656], [848, 656], [848, 694], [275, 694] ], "page_index": 0 }, "occupation": { "value": "ELECTRONIC TINING", "value_original": "ELECTRONIC TINING", "confidence": 0.9292, "confidence_text": 0.9714, "polygon": [ [275, 712], [275, 691], [464, 691], [464, 712] ], "page_index": 0 }, "status": { "value": "TKA BID. PERINDUSTRIAN", "value_original": "TKA BID. PERINDUSTRIAN", "confidence": 0.8924, "confidence_text": 0.9996, "polygon": [ [276, 719], [512, 719], [512, 738], [276, 738] ], "page_index": 0 }, "issued_date": { "value": "16-07-2019", "value_original": "Pangkalpinang, 16-07-2019", "confidence": 0.8738, "confidence_text": 0.9922, "polygon": [ [668, 958], [850, 958], [850, 978], [668, 978] ] }, "issued_place": { "value": "Pangkalpinang", "value_original": "Pangkalpinang, 16-07-2019", "confidence": 0.8738, "confidence_text": 0.9922, "polygon": [ [668, 958], [850, 958], [850, 978], [668, 978] ] }, "stay_entries_permit_expiry": { "value": "", "value_original": "", "confidence": 0.0, "confidence_text": 0.0, "polygon": [], "page_index": 0 }, "guarantor_name": { "value": "", "value_original": "", "confidence": 0.0, "confidence_text": 0.0, "polygon": [], "page_index": 0 }, "sign": { "value": "", "value_original": "", "confidence": 0.0, "confidence_text": 0.0, "polygon": [], "page_index": 0 } } }

Request ID

An associated request identifier is generated for every request made to this endpoint. This value can be found in the response headers under Request-Id


Responses

Various responses for this endpoint, in addition to general responses specified in Errors.

200 - OK

Request with readable KITAS/KITAP image

Response

1
2
3
4
5
{ "status": "SUCCESS", "reason": "File successfully read.", //..., }

200 - OK

Request with non KITAS/KITAP image

Response

1
2
3
4
5
{ "status": "SUCCESS", "reason": "File successfully read. Some fields are invalid.", //..., }

400 - Bad Request

Request without form-data image

Response

1
2
3
4
5
{ "status": "NO_FILE", "reason": "No file in request body", //..., }

415 - Unsupported Media Type

Request with non-image file format

Response

1
2
3
4
5
{ "status": "FILE_INVALID_FORMAT", "reason": "Failed to process invalid file format. Please upload the correct file format", //..., }