Referensi API Mobile
Seluruh endpoint API untuk aplikasi mobile dengan Sanctum Token Auth
Diperbarui: 22/6/2026
Autentikasi
Semua endpoint (kecuali login) memerlukan header:
---
Arsitektur API Mobile
Loading diagram...
---
Daftar Endpoint Lengkap
1. Authentication
| Method | URI | Auth | Deskripsi |
|---|---|---|---|
| POST | /api/authentication/login | ❌ | Login, return token |
| POST | /api/authentication/logout | ✅ | Logout, revoke token |
2. Attendance
| Method | URI | Deskripsi |
|---|---|---|
| POST | /api/attendance/check-in | Check-in (selfie + GPS) |
| POST | /api/attendance/check-out | Check-out (selfie + GPS) |
| GET | /api/attendance/today | Data absensi hari ini |
| GET | /api/attendance/today-schedule | Jadwal kerja hari ini |
| GET | /api/attendance/summary | Ringkasan kehadiran bulan ini |
| GET | /api/attendance/history | History absensi |
3. Face Recognition
| Method | URI | Deskripsi |
|---|---|---|
| GET | /api/face/check | Cek apakah sudah register face |
| POST | /api/face/enroll | Daftarkan wajah baru |
| POST | /api/face/detect-pose | Deteksi pose wajah |
| POST | /api/face/verify-liveness | Verifikasi liveness |
4. Leave / Cuti
| Method | URI | Deskripsi |
|---|---|---|
| GET | /api/leaves | List cuti saya |
| POST | /api/leaves | Ajukan cuti baru |
| GET | /api/leaves/balance | Sisa jatah cuti |
| GET | /api/leaves/subordinate | Cuti bawahan (supervisor) |
| POST | /api/leaves/{id}/approve | Approve cuti bawahan |
| POST | /api/leaves/{id}/reject | Reject cuti bawahan |
| POST | /api/leaves/{id}/cancel | Cancel cuti sendiri |
5. Work Visits
| Method | URI | Deskripsi |
|---|---|---|
| GET | /api/work-visits | List kunjungan |
| POST | /api/work-visits | Buat kunjungan baru |
| GET | /api/work-visits/{id} | Detail kunjungan |
| PUT | /api/work-visits/{id} | Update kunjungan |
| POST | /api/work-visits/{id}/check-in | Check-in kunjungan |
| POST | /api/work-visits/{id}/check-out | Check-out kunjungan |
| POST | /api/work-visits/{id}/photos | Upload foto kunjungan |
| DELETE | /api/work-visits/{id}/photos/{photoId} | Hapus foto |
6. Chat
| Method | URI | Deskripsi |
|---|---|---|
| GET | /api/chat/conversations | List percakapan |
| POST | /api/chat/conversations | Buat percakapan baru |
| GET | /api/chat/conversations/{id}/messages | Ambil pesan |
| POST | /api/chat/conversations/{id}/messages | Kirim pesan |
| POST | /api/chat/conversations/{id}/read | Tandai dibaca |
| POST | /api/chat/upload | Upload file |
| GET | /api/chat/search | Cari pesan |
7. Payroll
| Method | URI | Deskripsi |
|---|---|---|
| GET | /api/payroll | List slip gaji |
| GET | /api/payroll/{id} | Detail slip gaji |
8. Profile
| Method | URI | Deskripsi |
|---|---|---|
| GET | /api/profile | Data profil saya |
| PUT | /api/profile | Update profil |
9. Scanner
| Method | URI | Deskripsi |
|---|---|---|
| GET | /api/scanner/lookup/{barcode} | Lookup item by barcode |
10. FCM Token
| Method | URI | Deskripsi |
|---|---|---|
| POST | /api/fcm/token | Simpan FCM token |
| DELETE | /api/fcm/token | Hapus FCM token |
---
Error Response Format
| HTTP Code | Deskripsi |
|---|---|
| 200 | Success |
| 201 | Created |
| 401 | Unauthorized (token invalid/expired) |
| 403 | Forbidden (no permission) |
| 404 | Not Found |
| 422 | Validation Error |
| 500 | Server Error |