K
POST/v2/healthchecks

Create a healthcheck

Creates a new healthcheck. Supports two modes: Simple (periodic interval) and Cron (cron expression).

Request

Bodyapplication/json
namestringrequired
Name of the healthcheck
Example:"Daily Backup Job"
period_valuenumberoptional
Expected ping interval value. Required for simple mode (when cron is not provided)
Example:1
period_typeenum<string>optional
Unit for the period value. Required for simple mode
Available options:
secondsminuteshoursdays
grace_period_valuenumberrequired
Grace period value before alerting after a missed ping
Example:5
grace_period_typeenum<string>required
Unit for the grace period value
Available options:
secondsminuteshoursdays
cronstringoptional
A cron expression for scheduled jobs. If provided, the healthcheck uses cron mode instead of simple mode
Example:"0 2 * * *" (daily at 2 AM)
timezonestringoptional
Timezone for the cron expression
Default: UTC

Response

Returns the newly created healthcheck object.

Request (Simple mode)cURL
curl -X POST https://api.hyperping.io/v2/healthchecks \
  -H "Authorization: Bearer ${API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Hourly Data Sync",
    "period_value": 1,
    "period_type": "hours",
    "grace_period_value": 5,
    "grace_period_type": "minutes"
  }'
Request (Cron mode)cURL
curl -X POST https://api.hyperping.io/v2/healthchecks \
  -H "Authorization: Bearer ${API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Daily Backup Job",
    "cron": "0 2 * * *",
    "timezone": "America/New_York",
    "grace_period_value": 10,
    "grace_period_type": "minutes"
  }'
201 CreatedJSON
{
  "message": "Healthcheck created",
  "healthcheck": {
    "uuid": "tok_abc123def456",
    "name": "Daily Backup Job",
    "pingUrl": "https://hc.hyperping.io/tok_abc123def456",
    "period": 0,
    "periodValue": null,
    "periodType": null,
    "gracePeriod": 600,
    "gracePeriodValue": 10,
    "gracePeriodType": "minutes",
    "cron": "0 2 * * *",
    "timezone": "America/New_York"
  }
}