Documentation

API Sync

Mobile app connectivity monitoring — sync status and heartbeat endpoints

Last updated: Feb 09, 2026

API Sync

Endpoints for mobile app connectivity monitoring. Used by the admin panel's System → API Sync page to show connection status.

Note: Requires authentication. All authenticated API requests automatically update the sync heartbeat via the TrackApiSync middleware.

Get Sync Status

Get current sync/connectivity status.

GET /api/v1/system/api-sync/status
Headers: Authorization: Bearer {token} Response: 200 OK
{
  "connected": true,
  "sync_enabled": true,
  "last_sync_at": "2026-02-09T10:30:00",
  "last_status": "success",
  "last_message": "All data synchronized",
  "last_checked_at": "2026-02-09T10:35:00"
}
Note: connected is true if a heartbeat was received within the last 120 seconds.

Send Heartbeat

Report mobile app connectivity and sync status to the server.

POST /api/v1/system/api-sync/heartbeat
Headers: Authorization: Bearer {token} Request Body:
{
  "connected": true,
  "sync_enabled": true,
  "last_status": "success",
  "last_message": "Synchronized 42 products",
  "last_sync_at": "2026-02-09T10:30:00"
}

Request Fields

FieldTypeRequiredDescription
connectedbooleanYesWhether the app considers itself connected
sync_enabledbooleanNoWhether auto-sync is enabled in the app
last_statusstringNoStatus of the last sync operation
last_messagestringNoDescriptive message about the last sync
last_sync_atdatetimeNoTimestamp of the last sync operation
Response: 200 OK
{
  "success": true
}