/devices
Retrieve all devices associated with the authenticated user.
Use Case: Display registered devices on dashboard.
/devices/add
Returns form to add a new device (name, type, config).
Use Case: Navigate to “Add Device” screen.
/devices/add
Submits new device data to register it.
Use Case: Save a newly added device.
/devices/edit/:id
Fetches form to edit a device’s details.
Use Case: Display current settings for editing.
/devices/edit/:id
Updates the device’s details with submitted data.
Use Case: Save changes to an existing device.
/devices/delete/:id
Removes a device by its ID.
Use Case: Delete unused devices.
/devices/heartbeat/:id
Checks a device’s heartbeat status.
Use Case: Verify device is active.
/devices/alert/:id
Gets alert on the device.
Use Case: Test alert mechanism.
/devices/alert/:id
Sends an alert based on conditions.
Use Case: Automated alerts from rules engine.
/devices/test/:id
Runs a test of the alert system.
Use Case: Verify alert setup is working.
/devices/reset/:id
Clears all active alarms on a device.
Use Case: Reset after issue resolution.
/api/status
Returns a simple status message indicating the API is up and running.
Use Case: Automated monitoring or health-check scripts.
/api/login
Authenticates a user and returns a session token.
Use Case: Logging in via external applications.
Body: { "username": "...", "password": "..." }
/api/register
Creates a new user account.
Use Case: Allow third-party apps to onboard users.
Body: { "username": "...", "password": "..." }
/api/logout
Invalidates the user’s session token.
Use Case: Securely ending sessions from API clients.
/api/devices
Lists all devices linked to the authenticated user.
Use Case: External dashboards or scripts.
/api/devices/add
Registers a new device for the user.
Use Case: Programmatically add devices.
/api/devices/edit/:id
Modifies details of a specific device.
Use Case: Automated device configuration updates.
/api/devices/delete/:id
Removes a device by ID.
Use Case: Cleanup unused devices.
/api/devices/heartbeat/:id
Logs a heartbeat from a device.
Use Case: Device health monitoring.
/api/devices/alert/:id
Sends a manual alert to a device.
Use Case: External alert integrations.
/api/devices/reset/:id
Clears active alarms for a device.
Use Case: Automated alarm resets after issues resolved.
/logs/heartbeat
Retrieve all heartbeat events from monitored devices, including timestamp, device ID, and status.
Use Case: Audit device uptime and connectivity history.
/logs/alerts
Fetch a log of all triggered alerts, showing alert type, device ID, timestamp, and message.
Use Case: Diagnose past alerts for troubleshooting or compliance.
/logs/device/:id
Retrieve combined heartbeat and alert logs for one device, identified by ID.
Use Case: Analyze the full event history of a particular device.
/404
Returns a custom 404 page when the requested resource does not exist.
Use Case: Inform users they’ve navigated to an invalid URL.
/500
Displays a 500 error page when an unexpected server error occurs.
Use Case: Notify users of server-side failures and next steps.
/403
Shows a 403 page when the user lacks permission to view a resource.
Use Case: Prevent unauthorized access to restricted pages.