API checks
Requests an API on an interval and evaluates assertions on the status code, headers, JSON body, text body, or response time. A failed assertion stores evidence.
What api checks does
Requests an API on an interval and evaluates assertions on the status code, headers, JSON body, text body, or response time. A failed assertion stores evidence.
When to use api checks
- Contract checks on APIs
- Post-deploy verification
- Partner API monitoring
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: check-orders-api" \
-d '{
"name": "Orders API",
"type": "api_check",
"method": "GET",
"url": "https://api.example.com/orders/health",
"interval_seconds": 300,
"timeout_ms": 5000,
"assertions": [
{
"source": "status_code",
"operator": "equals",
"expected": 200
},
{
"source": "json_body",
"property": "$.status",
"operator": "equals",
"expected": "ok"
}
]
}'Response
Flowyn returns HTTP 201. The response is abridged here; the OpenAPI document lists every field.
{
"id": "8e3c5a7b-1d9f-4e2a-b6c4-0a7f3d1e9b52",
"environment": "test",
"name": "Orders API",
"type": "api_check",
"current_status": "waiting",
"interval_seconds": 300
}Lifecycle
- Create the check with its assertions.
- Each run evaluates every assertion; all must pass.
- A failed assertion stores evidence. Three consecutive failed results open an incident.
- A passing run records recovery.
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; the next interval runs again.
Idempotency
Send Idempotency-Key on create.
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,400timeout_ms100–30,000- Up to 20 assertions
Read it back
Keep the id and read the resource whenever you need its current state.
curl https://api.flowyn.dev/v1/monitors/8e3c5a7b-1d9f-4e2a-b6c4-0a7f3d1e9b52/results \
-H "Authorization: Bearer $FLOWYN_API_KEY"Related
Next step
See how repeated failures become one Issue.
