API Reference

Reliability SLA

Define success rate and latency targets per schema. Reliant evaluates your SLA continuously and fires your webhook automatically when a breach is detected — before your users notice.


SLA status values

StatusMeaning
healthyAll targets are being met in the current window
degradedTargets are missed by a small margin (<2% on success rate)
breachedTargets are significantly missed — webhook fires
unknownNot enough executions in the window to evaluate

POST /sla

Create or update the SLA for a schema. This is an upsert — if an SLA already exists for the schema, it will be updated.

json — request body
{ "schema_id": "invoice-extraction", "user_id": "your-user-id", "target_success_rate": 99.5, // required — minimum success rate % "target_latency_p95_ms": 2000, // optional — max P95 latency in ms "target_latency_avg_ms": 800, // optional — max average latency in ms "alert_window_minutes": 60, // default: 60 — evaluate over last N minutes "min_executions_to_alert": 5, // default: 5 — skip alert if too few samples "alert_webhook_url": "https://hooks.slack.com/..." // optional }
json — response
{ "id": "sla_...", "schema_id": "invoice-extraction", "target_success_rate": 99.5, "target_latency_p95_ms": 2000, "target_latency_avg_ms": 800, "alert_window_minutes": 60, "min_executions_to_alert": 5, "sla_status": "unknown", "current_success_rate": null, "current_latency_p95_ms": null, "current_latency_avg_ms": null, "last_evaluated_at": null, "is_active": true }

GET /sla/:schema_id/evaluate

Evaluate the current SLA status for a schema. Queries your execution history, calculates metrics, detects breaches, updates the stored status, and fires your webhook if needed.

http
GET /sla/invoice-extraction/evaluate?user_id=your-user-id X-Reliant-Key: rel_...
json — healthy response
{ "sla_id": "sla_...", "schema_id": "invoice-extraction", "status": "healthy", "breaches": [], "metrics": { "total": 142, "success": 141, "successRate": 99.3, "avgLatency": 621, "p95Latency": 1840 }, "evaluated_at": "2026-05-28T14:23:00.000Z" }
json — breached response
{ "sla_id": "sla_...", "schema_id": "invoice-extraction", "status": "breached", "breaches": [ "success_rate: 94.2% < target 99.5%", "p95_latency: 3200ms > target 2000ms" ], "metrics": { "total": 48, "success": 45, "successRate": 94.2, "avgLatency": 1840, "p95Latency": 3200 }, "evaluated_at": "2026-05-28T14:23:00.000Z" }

Webhook payload on breach

When a breach is detected and alert_webhook_url is configured, Reliant sends a POST request:

json — webhook body
{ "event": "sla.breach", "schema_id": "invoice-extraction", "status": "breached", "breaches": [ "success_rate: 94.2% < target 99.5%" ], "metrics": { "total": 48, "success": 45, "successRate": 94.2, "avgLatency": 1840, "p95Latency": 3200 }, "timestamp": "2026-05-28T14:23:00.000Z" }
Tip: You can call GET /sla/:schema_id/evaluate from your CI/CD pipeline after each deployment to check if the schema is still within SLA after the release. If status is breached, fail the deployment or trigger a rollback.

GET /sla

List all SLA configurations for the authenticated project.

GET /sla/:schema_id/history

Returns the last 50 breach log entries for a schema, ordered by most recent first.

json — breach history entry
{ "id": 42, "sla_id": "sla_...", "schema_id": "invoice-extraction", "breach_type": "success_rate", // success_rate | latency_p95 | latency_avg "target_value": 99.5, "actual_value": 94.2, "window_minutes": 60, "resolved_at": null, "created_at": "2026-05-28T14:23:00.000Z" }

DELETE /sla/:id

Delete an SLA configuration. Existing breach logs are not affected.