Scheduled tasks

Task types, creating a scheduled task, the Beat API and the grace period.

What are Scheduled Tasks?

Scheduled Tasks (also known as cron job monitoring or heartbeat monitoring) let you monitor background jobs, cron jobs, and any recurring processes. UptimeEye uses a dead man's switch approach: your task's job sends a beat to UptimeEye at regular intervals. If a beat is missed, UptimeEye alerts you.

Task Types

UptimeEye supports two types of scheduled tasks:

  • Simple Task - Define a fixed interval (e.g., every 5 minutes, every 2 hours, every 1 day). Best for tasks that run at regular intervals.
  • Cron Task - Use a cron expression (e.g., 0 9 * * 1-5) with timezone support. Best for tasks with complex schedules.

Creating a Scheduled Task

To create a new scheduled task:

  1. Open Scheduled Tasks in the sidebar
  2. Click "New scheduled task"
  3. Enter a name for your task
  4. Select a notification channel to receive alerts
  5. Choose the task type (Simple or Cron)
  6. Configure the schedule (interval or cron expression with timezone)
  7. Optionally set a grace period (minutes to wait before marking as down)
  8. Click "Create task" to save your configuration

Beat API (Integration Endpoints)

After creating a scheduled task, you'll receive a unique task ID. Use this ID to send beats from your application using simple HTTP requests. All endpoints accept GET, POST, and HEAD methods.

EndpointDescription
/v1/beat/{taskId}Report a successful execution (default beat)
/v1/beat/{taskId}/successExplicitly report success
/v1/beat/{taskId}/failReport a failure (triggers alert immediately)
/v1/beat/{taskId}/startSignal that the task has started running

Example usage with cURL:

shell
# Send a beat after your cron job completes
curl -X GET https://api.uptimeeye.com/v1/beat/YOUR_TASK_ID

# Report failure if something goes wrong
curl -X POST https://api.uptimeeye.com/v1/beat/YOUR_TASK_ID/fail

Grace Period

The grace period defines how many minutes UptimeEye waits after a missed beat before marking the task as down and sending an alert. This is useful for tasks that may occasionally take longer than expected. Set it to 0 for immediate alerting.