API Reference — Gateway
Endpoint untuk mengelola IP Whitelist, Whitelist Resource, dan menelusuri Log History request API Gateway.
← Kembali ke Gateway
Panduan operator: tambah, edit, hapus IP whitelist, dan menelusuri Log History.
Otentikasi
Cara memperoleh dan menggunakan Bearer token JWT.
Semua endpoint memerlukan header Authorization: Bearer <token>. Basis URL mengikuti variabel lingkungan VITE_API_URL yang dikonfigurasi pada instalasi Lenz. Jika Anda belum punya token, lihat halaman Otentikasi.
Whitelist Resource
Whitelist Resource adalah definisi endpoint atau kelompok endpoint yang dilindungi oleh API Gateway. Setiap entri IP Whitelist harus merujuk ke salah satu resource yang terdaftar.
Authorization
bearerAuth In: header
Query Parameters
Nomor halaman, dimulai dari 1.
1Jumlah item per halaman.
20Filter berdasarkan status aktif resource.
Nama kolom yang digunakan untuk pengurutan, misalnya name atau created_at.
Arah pengurutan.
"DESC""ASC" | "DESC"Response Body
application/json
curl -X GET "https://lenz.example.com/api/gateway/v1/whitelist/resources"{ "data": [ { "id": 1, "name": "Face Recognition", "route": "/v1/util/face-search/demography", "description": "Endpoint pencarian wajah dengan data demografi Dukcapil.", "is_active": true, "created_at": "2025-01-01T00:00:00Z", "updated_at": "2025-06-01T08:00:00Z" }, { "id": 2, "name": "Plate Recognition", "route": "/v1/util/no-pol-korlantas", "description": "Endpoint pencarian plat nomor kendaraan dari Korlantas.", "is_active": true, "created_at": "2025-01-01T00:00:00Z", "updated_at": "2025-06-01T08:00:00Z" } ], "total": 2, "page": 1, "page_size": 20, "total_pages": 1}Authorization
bearerAuth In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X POST "https://lenz.example.com/api/gateway/v1/whitelist/resources" \ -H "Content-Type: application/json" \ -d '{ "name": "NIK Search", "route": "/v1/util/nik-search" }'{ "message": "resource created successfully", "data": { "id": 3, "name": "NIK Search", "route": "/v1/util/nik-search", "description": "Pencarian data penduduk berdasarkan NIK.", "is_active": true, "created_at": "2026-04-30T08:00:00Z", "updated_at": "2026-04-30T08:00:00Z" }}Authorization
bearerAuth In: header
Path Parameters
ID numerik whitelist resource.
Response Body
application/json
application/json
curl -X GET "https://lenz.example.com/api/gateway/v1/whitelist/resources/0"{ "id": 1, "name": "Face Recognition", "route": "/v1/util/face-search/demography", "description": "Endpoint pencarian wajah dengan data demografi Dukcapil.", "is_active": true, "created_at": "2025-01-01T00:00:00Z", "updated_at": "2025-06-01T08:00:00Z"}{ "code": 404, "message": "resource not found"}Authorization
bearerAuth In: header
Path Parameters
ID numerik whitelist resource.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X PUT "https://lenz.example.com/api/gateway/v1/whitelist/resources/0" \ -H "Content-Type: application/json" \ -d '{}'{ "message": "resource updated successfully", "data": { "id": 1, "name": "Face Recognition (Updated)", "route": "/v1/util/face-search/demography", "description": "Versi baru endpoint pencarian wajah.", "is_active": true, "created_at": "2025-01-01T00:00:00Z", "updated_at": "2026-04-30T09:00:00Z" }}Authorization
bearerAuth In: header
Path Parameters
ID numerik whitelist resource.
Response Body
application/json
curl -X DELETE "https://lenz.example.com/api/gateway/v1/whitelist/resources/0"{ "message": "resource deleted successfully"}IP Whitelist
Manajemen daftar alamat IP yang diizinkan mengakses endpoint tertentu melalui API Gateway. Setiap entri mengonfigurasi kuota, satuan periode, masa berlaku, dan resource yang dapat diakses.
Alamat IP tidak dapat diubah setelah entri dibuat. Jika perlu mengganti alamat IP, hapus entri lama dan buat entri baru dengan IP yang benar.
Authorization
bearerAuth In: header
Query Parameters
Nomor halaman, dimulai dari 1.
1Jumlah item per halaman.
20Pencarian parsial berdasarkan alamat IP, nama resource, atau satuan.
Filter berdasarkan status entri.
"active" | "inactive"Filter berdasarkan whitelist_resource_id.
Filter berdasarkan satuan kuota.
"daily" | "monthly" | "yearly"Filter berdasarkan alamat IP (pencocokan eksak).
Filter entri dengan valid_until setelah tanggal tertentu (YYYY-MM-DD).
dateFilter entri dengan valid_until sebelum tanggal tertentu (YYYY-MM-DD).
dateUrutkan berdasarkan waktu pembuatan.
"ASC" | "DESC"Urutkan berdasarkan alamat IP.
"ASC" | "DESC"Response Body
application/json
curl -X GET "https://lenz.example.com/api/gateway/v1/whitelist/ip-addresses"{ "ok": true, "message": "successfully get whitelisted ips", "results": { "limit": 20, "current_page": 1, "total_data": 2, "total_page": 1, "whitelisted_ips": [ { "id": 42, "ip_address": "203.0.113.45", "whitelist_resource_id": 1, "whitelist_resource": { "id": 1, "name": "Face Recognition", "route": "/v1/util/face-search/demography", "description": "Endpoint pencarian wajah dengan data demografi Dukcapil.", "is_active": true, "created_at": "2025-01-01T00:00:00Z", "updated_at": "2025-06-01T08:00:00Z" }, "unit": "monthly", "quota": 1000, "unlimited_quota": false, "valid_until": "2026-12-31", "status": "active", "created_at": "2025-01-01T08:00:00Z", "updated_at": "2025-06-15T10:30:00Z" } ] }}Authorization
bearerAuth In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://lenz.example.com/api/gateway/v1/whitelist/ip-addresses" \ -H "Content-Type: application/json" \ -d '{ "ip_address": "203.0.113.45", "whitelist_resource_id": 1, "unit": "monthly", "quota": 1000, "status": "active" }'{ "ok": true, "message": "successfully created whitelisted ip", "whitelisted_ip": { "id": 42, "ip_address": "203.0.113.45", "whitelist_resource_id": 1, "whitelist_resource": { "id": 1, "name": "Face Recognition", "route": "/v1/util/face-search/demography", "description": "Endpoint pencarian wajah dengan data demografi Dukcapil.", "is_active": true, "created_at": "2025-01-01T00:00:00Z", "updated_at": "2025-06-01T08:00:00Z" }, "unit": "monthly", "quota": 1000, "unlimited_quota": false, "valid_until": "2026-12-31", "status": "active", "created_at": "2026-04-30T08:00:00Z", "updated_at": "2026-04-30T08:00:00Z" }}{ "ok": false, "code": "validation-error", "errors": [ "ip_address is required" ], "message": "validation failed"}Authorization
bearerAuth In: header
Path Parameters
ID numerik entri IP whitelist.
Response Body
application/json
application/json
curl -X GET "https://lenz.example.com/api/gateway/v1/whitelist/ip-addresses/0"{ "ok": true, "message": "successfully get whitelisted ip", "whitelisted_ip": { "id": 42, "ip_address": "203.0.113.45", "whitelist_resource_id": 1, "whitelist_resource": { "id": 1, "name": "Face Recognition", "route": "/v1/util/face-search/demography", "description": "Endpoint pencarian wajah dengan data demografi Dukcapil.", "is_active": true, "created_at": "2025-01-01T00:00:00Z", "updated_at": "2025-06-01T08:00:00Z" }, "unit": "monthly", "quota": 1000, "unlimited_quota": false, "valid_until": "2026-12-31", "status": "active", "created_at": "2025-01-01T08:00:00Z", "updated_at": "2025-06-15T10:30:00Z" }}{ "ok": false, "code": "not-found", "errors": [], "message": "whitelisted ip not found"}Authorization
bearerAuth In: header
Path Parameters
ID numerik entri IP whitelist.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
curl -X PUT "https://lenz.example.com/api/gateway/v1/whitelist/ip-addresses/0" \ -H "Content-Type: application/json" \ -d '{ "ip_address": "203.0.113.45", "whitelist_resource_id": 1, "unit": "monthly", "quota": 2000, "status": "active" }'{ "ok": true, "message": "successfully updated whitelisted ip"}Authorization
bearerAuth In: header
Path Parameters
ID numerik entri IP whitelist.
Response Body
application/json
curl -X DELETE "https://lenz.example.com/api/gateway/v1/whitelist/ip-addresses/0"{ "ok": true, "message": "successfully deleted whitelisted ip"}Gateway
Kelola IP yang diizinkan masuk ke API Gateway, pantau status kuota, dan telusuri log request secara lengkap.
Workflows
Otomatisasi rangkaian aksi berdasarkan Trigger yang terjadwal atau dipicu secara manual — bangun pipeline low-code untuk mengirim notifikasi, ekspor data, dan integrasi sistem eksternal tanpa menulis kode.