Start Monitoring
POST /api/agents/monitor/start
Start monitoring a URL for content changes.
Validates the URL (SSRF guard), persists the monitor record to SQLite, then registers the URL with Lagan’s in-memory web_monitor. SQLite is written first — if Lagan registration fails the row is rolled back so we never report success when the URL was never actually registered.
Args: request: MonitoringStartRequest with URL and monitoring config.
Returns: MonitoringStartResponse with monitor_id, status, and next_check_at.
Raises: HTTPException 400: No active project set, or URL rejected by the outbound URL validator. HTTPException 503: Lagan agent or its web_monitor tool unavailable.
Request Body required
Section titled “Request Body required ”Request to start monitoring a URL for changes.
Initiates continuous monitoring of a webpage for content changes with configurable check intervals and change detection thresholds.
Fields:
url: URL to monitor for changes (required, must be valid HTTP/HTTPS)interval_minutes: Check interval in minutes (5-1440, default 60)change_threshold: Content change threshold percentage (0.0-1.0, default 0.1)notify_on_change: Whether to send notifications on content changes
Constraints:
- Minimum interval: 5 minutes (to prevent excessive requests)
- Maximum interval: 1440 minutes (24 hours)
- Change threshold: 0.1 = 10% content change triggers notification
Usage: Used to initiate web monitoring operations for change detection.
Integration:
- MonitoringRoutes: Request validation for /monitoring/start endpoint
- MonitoringService: Change detection configuration
- Notification System: Change notification triggers
object
URL to monitor for changes
Check interval in minutes (5-1440)
Content change threshold (0.0-1.0, 0.1 = 10% change)
Whether to send notifications on content changes
Responses
Section titled “ Responses ”Successful Response
Response after starting a monitoring operation.
Confirms monitoring operation initiation with assigned monitor ID and scheduling information.
Fields:
success: Whether monitoring started successfullymonitor_id: Unique identifier for this monitoring operationurl: URL being monitoredinterval_minutes: Configured check interval in minutesstatus: Current monitor status (active, initializing, error)next_check_at: ISO timestamp of next scheduled checkmessage: Human-readable status message
Status Values:
active: Monitor is running and scheduledinitializing: Monitor is starting uperror: Monitor failed to start
Usage: Returned after successfully starting a monitoring operation.
Integration:
- MonitoringRoutes: Response model for /monitoring/start endpoint
- Frontend: Monitor status display
object
Whether monitoring started successfully
Unique identifier for this monitoring operation
URL being monitored
Check interval in minutes
Monitor status
Status message
Validation Error