HTTP monitors

Requests a URL on a fixed interval, records each result with status and latency, opens an incident after three consecutive failed results, and records recovery on the next pass.

What http monitors does

Requests a URL on a fixed interval, records each result with status and latency, opens an incident after three consecutive failed results, and records recovery on the next pass.

When to use http monitors

  • Public API health
  • An agent's HTTP endpoint
  • Staging smoke checks

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.

http
Authorization: Bearer flw_test_••••

Endpoint

http
POST https://api.flowyn.dev/v1/monitors

Request

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: monitor-prod-health" \
  -d '{
    "name": "Production API",
    "type": "http",
    "method": "GET",
    "url": "https://api.example.com/health",
    "interval_seconds": 60,
    "timeout_ms": 5000,
    "assertions": [
      {
        "source": "status_code",
        "operator": "equals",
        "expected": 200
      }
    ]
  }'

Response

Flowyn returns HTTP 201. The response is abridged here; the OpenAPI document lists every field.

Response
{
  "id": "8e3c5a7b-1d9f-4e2a-b6c4-0a7f3d1e9b52",
  "environment": "test",
  "name": "Production API",
  "type": "http",
  "enabled": true,
  "paused": false,
  "current_status": "waiting",
  "method": "GET",
  "url": "https://api.example.com/health",
  "interval_seconds": 60,
  "timeout_ms": 5000,
  "last_checked_at": null
}

Lifecycle

  1. Create the monitor. The first check runs within the interval.
  2. Each check stores a result with status, latency, and evidence for failed assertions.
  3. Three consecutive failed results open an incident.
  4. The next passing result closes the incident as recovered. Read incidents with GET /v1/monitors/{id}/incidents.

Status values

StatusMeaning
waitingNo result yet.
healthyThe latest result passed.
degradedResults are mixed.
failingRecent results failed.
pausedNot checking.

Retries

Monitors do not retry a check; they check again at the next interval.

Idempotency

Send Idempotency-Key on create.

Errors

StatustypeMeaning
400invalid_requestThe body is not valid JSON, a field has the wrong type, or the body is over 1 MiB (body_too_large).
401unauthorizedMissing, malformed, or revoked API key.
402billing_errorThe monthly credit allowance is used (credit_limit_exceeded). Reads keep working.
403forbiddenThe key lacks the ability this call needs (ability_required).
404not_foundThe id does not exist in this environment.
409conflictFor example idempotency_mismatch: the Idempotency-Key was used with a different body.
422invalid_requestA field value is out of range, for example invalid_timeout.
429rate_limitedToo many requests (rate_limit_exceeded). Wait for Retry-After seconds.
5xxserver_errorFlowyn failed. The body carries an error_id to quote to support.

Limits

  • interval_seconds 30–86,400
  • timeout_ms 100–30,000
  • Up to 20 assertions

Read it back

Keep the id and read the resource whenever you need its current state.

bash
curl https://api.flowyn.dev/v1/monitors/8e3c5a7b-1d9f-4e2a-b6c4-0a7f3d1e9b52/results \
  -H "Authorization: Bearer $FLOWYN_API_KEY"

Next step

Watch processes that cannot be polled with Heartbeats.