Skip to main content
POST
/
heartbeats
Create a new heartbeat
curl --request POST \
  --url https://upcron.io/api/heartbeats \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Daily Backup Job",
  "project_id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
  "grace_period": 3600,
  "cron_schedule": "0 2 * * *",
  "next_ping_at": "2024-01-02T12:00:00Z"
}
'
{
  "message": "Heartbeat created successfully",
  "data": {
    "id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
    "name": "Daily Backup Job",
    "project_id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
    "grace_period": 3600,
    "next_ping_at": "2024-01-02T12:00:00.000000Z",
    "cron_schedule": "0 2 * * *",
    "created_at": "2024-01-01T12:00:00.000000Z",
    "updated_at": "2024-01-01T12:00:00.000000Z",
    "ping_url": "https://ping.upcron.io/heartbeat/uuid",
    "start_url": "https://ping.upcron.io/heartbeat/uuid/start",
    "fail_url": "https://ping.upcron.io/heartbeat/uuid/fail",
    "project": {
      "id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
      "name": "My Project",
      "description": "Project description"
    }
  }
}

Authorizations

Authorization
string
header
required

Laravel Sanctum Bearer token authentication

Body

application/json
name
string
required
Maximum string length: 255
Example:

"Daily Backup Job"

project_id
string<uuid>
required
Example:

"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"

grace_period
integer
required

Grace period in seconds (60 to 86400)

Required range: 60 <= x <= 86400
Example:

3600

cron_schedule
string
required
Maximum string length: 255
Example:

"0 2 * * *"

next_ping_at
string<date-time> | null
Example:

"2024-01-02T12:00:00Z"

Response

Heartbeat created successfully

message
string
Example:

"Heartbeat created successfully"

data
object