Create a heartbeat

Returns either a newly created heartbeat, or validation errors.

POST https://betteruptime.com/api/v2/heartbeats

Headers

Authorization
required string
Content-type
String

Body parameters

name
string
period
integer
grace
integer
call
boolean
sms
boolean
email
boolean
push
boolean
team-wait
integer
heartbeat_group_id
integer
sort_index
integer
paused
boolean
policy_id
integer
201

Response body

{
  "data": {
    "id": "12345",
    "type": "heartbeat",
    "attributes": {
      "url": "https://betteruptime.com/api/v1/heartbeat/abcd1234abcd1234abcd1234",
      "name": "Testing heartbeat",
      "period": 10800,
      "grace": 300,
      "call": false,
      "sms": false,
      "email": true,
      "push": true,
      "team_wait": 180,
      "heartbeat_group_id": null,
      "sort_index": null,
      "paused_at": null,
      "created_at": "2020-05-05T11:41:49.327Z",
      "updated_at": "2020-12-10T15:00:15.089Z"
    }
  }
}
422

Response body

{
  "errors": {
    "name": [
      "Can't be blank."
    ]
  }
}

Example cURL

curl --request POST \
  --url https://betteruptime.com/api/v2/heartbeats \
  --header 'Authorization: Bearer YOUR_API_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
    "name": "Testing heartbeat",
    "period": 10800,
    "grace": 300
}'
Copied!