Heartbeats
Expects a ping from your process. If no ping arrives within twice `interval_seconds`, Flowyn records a missed heartbeat. Three consecutive misses open an incident; the next ping closes it.
What heartbeats does
Expects a ping from your process. If no ping arrives within twice interval_seconds, Flowyn records a missed heartbeat. Three consecutive misses open an incident; the next ping closes it.
When to use heartbeats
- Nightly cron jobs
- Queue workers
- Agents that run on a timetable
Authentication
Send an API key as a bearer token. Keys are shown once, belong in a server environment, and are bound to one environment: flw_test_ keys act in test and flw_live_ keys in live.
Authorization: Bearer flw_test_••••Endpoint
POST https://api.flowyn.dev/v1/monitorsRequest
Send an Idempotency-Key so a retried request cannot create a duplicate. The body is JSON.
curl -X POST https://api.flowyn.dev/v1/monitors \
-H "Authorization: Bearer $FLOWYN_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: hb-nightly-backup" \
-d '{
"name": "Nightly backup",
"type": "heartbeat",
"method": "GET",
"url": "",
"interval_seconds": 86400,
"timeout_ms": 1000,
"assertions": []
}'Response
Flowyn returns HTTP 201. The response is abridged here; the OpenAPI document lists every field.
{
"id": "1a6d8f2c-5b3e-4a9d-8c7f-6e0b2d4a1c95",
"environment": "test",
"name": "Nightly backup",
"type": "heartbeat",
"enabled": true,
"paused": false,
"current_status": "waiting",
"interval_seconds": 86400
}Lifecycle
- Create the heartbeat with
type: heartbeatand an emptyurl. - Your process calls
POST /v1/monitors/{id}/pingwith your API key at the end of each successful run. - If no ping arrives within twice the interval, Flowyn records a missed heartbeat.
- Three consecutive misses open an incident; the next ping closes it.
Status values
| Status | Meaning |
|---|---|
| waiting | No result yet. |
| healthy | The latest result passed. |
| degraded | Results are mixed. |
| failing | Recent results failed. |
| paused | Not checking. |
Retries
Not applicable.
Idempotency
Pings are safe to repeat; each one is recorded as a result.
Errors
| Status | type | Meaning |
|---|---|---|
| 400 | invalid_request | The body is not valid JSON, a field has the wrong type, or the body is over 1 MiB (body_too_large). |
| 401 | unauthorized | Missing, malformed, or revoked API key. |
| 402 | billing_error | The monthly credit allowance is used (credit_limit_exceeded). Reads keep working. |
| 403 | forbidden | The key lacks the ability this call needs (ability_required). |
| 404 | not_found | The id does not exist in this environment. |
| 409 | conflict | For example idempotency_mismatch: the Idempotency-Key was used with a different body. |
| 422 | invalid_request | A field value is out of range, for example invalid_timeout. |
| 429 | rate_limited | Too many requests (rate_limit_exceeded). Wait for Retry-After seconds. |
| 5xx | server_error | Flowyn failed. The body carries an error_id to quote to support. |
Limits
interval_seconds30–86,400- A ping body may report
statussuccess,failed, ordownwith an optionalerror
Read it back
Keep the id and read the resource whenever you need its current state.
curl https://api.flowyn.dev/v1/monitors/1a6d8f2c-5b3e-4a9d-8c7f-6e0b2d4a1c95/results \
-H "Authorization: Bearer $FLOWYN_API_KEY"Related
Next step
Assert on response bodies with API checks.
