Original routes and ingest
Still supported. The nine original routes below and the ingest routes keep working exactly as before, with the same token and scopes. For anything new, use the tools API: it covers all of these and much more.
- Bodies are JSON; the ingest routes also take raw CSV (
Content-Type: text/csv). - Open a route for its fields, an example and its response.
- Errors:
422(bad input, with a message),404(unknown or someone else’s id),401(bad token),403(the token lacks the scope),429(over 120 requests a minute).
Models & reliability
GET/api/v1/modelsList your saved models (life-data and degradation).
/api/v1/models{
"models": [
{ "id": "a1b2…", "name": "Bearing life", "kind": "distribution",
"distribution": "Weibull", "n": 30, "unit": "hours",
"created_at": "2026-07-15T02:48:08+00:00", "url": "/modelling/m/a1b2…" }
]
}GET/api/v1/models/{id}A model's fitted parameters, life metrics, and goodness-of-fit.
/api/v1/models/{id}id | string · path | required | Model id. |
{
"id": "a1b2…", "name": "Bearing life", "distribution": "Weibull",
"kind": "distribution", "unit": "hours", "n": 30,
"params": [ { "name": "alpha", "value": 1435.1, "se": 108.9, "ci": [1220, 1650] },
{ "name": "beta", "value": 2.5, "ci": [1.78, 3.21] } ],
"coefficients": [], // populated for proportional-hazards models
"metrics": null, // {median, mttf, b10} for discrete / non-parametric
"gof": [ { "id": "aic", "label": "AIC", "value": 466.3 }, … ],
"validation": { … } // regression models only: how good is this model?
// {available, concordance: {value, rating, reading},
// brier: {model, baseline, improvement, from, to, reading},
// auc: [{time, value}], n_units, sampled, note}
// or {available: false, reason}
"diagnostics": { … } // regression models only: does the model hold?
// {ph_test: {available, verdict, title, reading,
// rows: [{covariate, statistic, df, p}],
// global: {statistic, df, p}},
// robust?, ties?, strata?} (Cox PH adds the last three)
}POST/api/v1/models/{id}/reliabilityEvaluate the reliability functions. With t you get point values; without it, the full grid.
/api/v1/models/{id}/reliabilityt | number | optional | Time to evaluate at. Omit for the whole curve. |
covariates | object | optional | Covariate values for a proportional-hazards model, e.g. {"temp_C": 90}. |
curl -X POST https://reliafy.com/api/v1/models/MODEL_ID/reliability \
-H "Authorization: Bearer rlf_..." -H "Content-Type: application/json" \
-d '{"t": 1000}'{
"model": "Bearing life", "unit": "hours",
"at": { "t": 1000, "reliability": 0.666, "failure": 0.334,
"hazard": 0.00101, "cumulative_hazard": 0.406, "density": 0.000675 }
}
// without "t": { "model": …, "unit": …, "curves": { "x": [...], "sf": [...], "ff": [...], "hf": [...], "Hf": [...], "df": [...] } }Datasets & fitting
POST/api/v1/datasetsCreate a dataset from CSV text or column arrays.
/api/v1/datasetsname | string | required | Dataset name. |
csv | string | optional | Raw CSV text (with a header row). Provide this or data. |
data | object | optional | Column arrays, e.g. {"hours": [...], "failed": [...]}. |
curl -X POST https://reliafy.com/api/v1/datasets \
-H "Authorization: Bearer rlf_..." -H "Content-Type: application/json" \
-d '{"name": "Bearings", "csv": "hours,failed\n120,1\n340,0"}'{ "id": "d3…", "name": "Bearings", "n_rows": 2,
"columns": ["hours", "failed"], "url": "/modelling/data/d3…" }POST/api/v1/fitFit and save a model from one of your datasets.
/api/v1/fitname | string | required | Model name. |
dataset_id | string | required | Id of the dataset to fit. |
distribution | string | required | e.g. weibull, lognormal, weibull_ph, discrete_weibull, best. Every id is listed in the model reference: bounded (beta, uniform), discretized, royston_parmar, the semi-parametric additive_hazards / proportional_odds / buckley_james, and shared frailty (weibull_frailty, cox_frailty, …). |
mapping | object | required | Role → column, e.g. {"x": "hours", "c": "failed"}. Covariates that change over time (regression models): add "i", the item column, with each row's start and stop as "xl" / "xr" (or a timeline's times as "x"). A shared-frailty model also takes "group": the site or batch column. |
unit | string | optional | Unit of the time axis. |
covariates | string[] | optional | Covariate columns for a PH model. |
formula | string | optional | Formulaic covariate formula (alternative to covariates). |
curl -X POST https://reliafy.com/api/v1/fit \
-H "Authorization: Bearer rlf_..." -H "Content-Type: application/json" \
-d '{"name": "Bearing life", "dataset_id": "d3…", "distribution": "weibull",
"mapping": {"x": "hours", "c": "failed"}, "unit": "hours"}'{ "id": "a1b2…", "name": "Bearing life", "kind": "distribution",
"distribution": "Weibull", "n": 2, "unit": "hours",
"created_at": "…", "url": "/modelling/m/a1b2…" }Fleet forecasts
GET/api/v1/fleets/{id}/forecastThe live failure forecast — expected failures per period. Id is in /fleet/forecasts/<id>.
/api/v1/fleets/{id}/forecastid | string · path | required | Fleet id. |
{
"fleet": { "id": "f1…", "name": "Delivery trucks", "model_id": "a1b2…" },
"forecast": { "status": "ok", "method": "renewals", "periods": 12,
"period_label": "months", "expected_failures": [0.4, 0.9, …],
"total_expected": 11.7 }
}Strategy calculators
POST/api/v1/strategy/optimal-replacementCost-optimal preventive-replacement interval.
/api/v1/strategy/optimal-replacementdistribution_id | string | required | e.g. weibull. |
params | number[] | {name,value}[] | required | Distribution parameters. |
planned_cost | number | required | Cost of a planned replacement. |
unplanned_cost | number | required | Cost of a failure. |
unit | string | optional | Time unit for display. |
{ "distribution": "Weibull", "unit": "hours", "mttf": 1272.4,
"beneficial": true, "optimal_time": 580.5, "optimal_cost_rate": 0.51,
"planned_cost": 200, "unplanned_cost": 1500 }POST/api/v1/strategy/failure-findingInspection interval that keeps a hidden (protective) function available.
/api/v1/strategy/failure-findingdistribution_id | string | required | e.g. exponential. |
params | number[] | {name,value}[] | required | Distribution parameters. |
target_availability | number | required | Target availability in (0,1), e.g. 0.99. |
unit | string | optional | Time unit for display. |
{ "distribution": "Exponential", "unit": "hours", "mttf": 8760,
"target_availability": 0.99, "interval": 176.4, "method": "…", "note": "…" }POST/api/v1/strategy/demonstration-testPlan a reliability demonstration test (success run, binomial, Weibayes or MTBF).
/api/v1/strategy/demonstration-testreliability | number | required | Reliability to show over one mission, in (0,1) (attribute tests). |
confidence | number | optional | Confidence in (0,1), default 0.95. |
mission_time | number | optional | The mission time; omit to plan in missions. |
failures | int | optional | Failures the test allows, default 0. |
test_multiple | number | optional | Test length per unit in missions (needs shape when not 1). |
shape | number | optional | Weibull shape β of the lifetime, assumed known. |
units | int | optional | Units available: solve for the test time per unit instead. |
method / mtbf | string / number | optional | method="mtbf" with an MTBF plans a constant-rate (chi-squared) test. |
design_reliability | number | optional | A design's true reliability: its chance of passing. |
b_life | number | optional | A B-life requirement instead of reliability: 10 for “B10 ≥ mission_time”. |
shape_interval | number[2] | optional | β’s interval [lower, upper] (e.g. a fit’s 95% interval): adds shape_sensitivity, with a warning when β is too poorly known for the plan. |
unit | string | optional | Time unit for display. |
{ "method": "attribute", "solve_for": "units", "units": 59,
"test_time_per_unit": 1000, "total_test_time": 59000, "failures": 0,
"demonstrated_reliability": 0.9505, "consumer_risk": 0.0485,
"summary": "Test 59 units for 1,000 hours each with no failures to show …",
"assumptions": ["…"], "tradeoff": { "failures": [0,1,2,3], "rows": [{ "label": "1,000 hours (1×)", "values": [59,93,124,153] }] } }Push operational data (ingest)
Append data to existing artifacts — JSON or raw CSV, idempotent, atomic (a bad row is a 422 with no changes applied).
POST/api/ingest/fleets/{fleet_id}/usageUpdate forecast items' current use, then recompute the forecast and check the fleet's alerts.
/api/ingest/fleets/{fleet_id}/usagename / id | csv col | required | Item name (or id). |
current_use | csv col | required | Accumulated use so far (the meter reading). |
rate | csv col | optional | Optional manual per-period usage rate. |
read_at | csv col | optional | When the meter was read, ISO 8601 (e.g. 2026-09-27T08:00:00+10:00; no offset = UTC). Default: the request time. Readings older than the item's latest are ignored. |
curl -X POST https://reliafy.com/api/ingest/fleets/FLEET_ID/usage \
-H "Authorization: Bearer rlf_..." -H "Content-Type: text/csv" \
--data-binary @meter_readings.csv # name,current_use,read_at{ "fleet": "…", "updated_items": 8, "forecast": { … }, "alerts_fired": 0 }- Usage-rate estimate. Each reading at least a day after the previous one updates the item's estimated usage per period: Δuse ÷ elapsed periods, smoothed (EWMA, α = 0.3). Elapsed time is converted with the fleet's period label — days, weeks, months (30.44 d), quarters or years; any other label gets no estimate. A reading lower than the last one (meter reset or replaced unit) restarts the baseline without estimating.
rate_source(fleet setting,"manual"by default): set it to"estimated"on the fleet page to forecast with each item's estimated rate, falling back to its manual rate, then the fleet default. The forecast'sper_itemrows reportrate_usedandrate_basis.- Alerts. Ingesting usage evaluates the fleet's alert rules (set on the fleet page) against the recomputed forecast and emails their owners — one email per crossing.
alerts_firedcounts the rules that fired; an alert problem never fails the ingest.
POST/api/ingest/tracking/{fleet_id}/measurementsAppend (item, time, value) readings to a tracked fleet and re-predict remaining life.
/api/ingest/tracking/{fleet_id}/measurementsmeasurements | object[] | required | [{item, time, value}, …] (JSON), or CSV columns item,time,value. |
-d '{"measurements": [{"item": "Pump 7", "time": 5300, "value": 6.1}]}'{ "updated": 1, "items": [ { … } ] }POST/api/ingest/datasets/{dataset_id}/livesAppend failure rows to a dataset and refit its models in place.
/api/ingest/datasets/{dataset_id}/livesrefit | bool · query | optional | Default true; ?refit=false to skip refitting. |
(rows) | csv / json | required | Rows whose columns match the dataset. |
{ "appended": 12, "n_rows": 142, "refit": [ { "id": "…", "name": "…" } ] }Reliafy Maintenance users also have an ingest route for automated meter and condition readings; it’s described in the app.
Model import
POST/api/import/modelsCreate a model from a fit done elsewhere (what reliafy.push wraps).
/api/import/modelsname | string | required | Model name. |
distribution | string | required | SurPyval name or Reliafy id. |
unit | string | optional | Time unit. |
data | object | optional | {x, c?, n?} arrays — refit into a full model. Provide this or params. |
params | {name,value}[] | optional | Parameters for a params-only model. |
options / extras | object | optional | offset/zi/lfp (data) or gamma/p/f0 (params). |
{ "id": "a1b2…", "name": "Pump bearings", "distribution": "Weibull",
"params_only": false, "url": "/modelling/m/a1b2…" }