Reliafy

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/models

List your saved models (life-data and degradation).

Response · 200
{
  "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.

Request
idstring · pathrequiredModel id.
Response · 200
{
  "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}/reliability

Evaluate the reliability functions. With t you get point values; without it, the full grid.

Request
tnumberoptionalTime to evaluate at. Omit for the whole curve.
covariatesobjectoptionalCovariate 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}'
Response · 200
{
  "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/datasets

Create a dataset from CSV text or column arrays.

Request
namestringrequiredDataset name.
csvstringoptionalRaw CSV text (with a header row). Provide this or data.
dataobjectoptionalColumn 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"}'
Response · 200
{ "id": "d3…", "name": "Bearings", "n_rows": 2,
  "columns": ["hours", "failed"], "url": "/modelling/data/d3…" }
POST/api/v1/fit

Fit and save a model from one of your datasets.

Request
namestringrequiredModel name.
dataset_idstringrequiredId of the dataset to fit.
distributionstringrequirede.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, …).
mappingobjectrequiredRole → 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.
unitstringoptionalUnit of the time axis.
covariatesstring[]optionalCovariate columns for a PH model.
formulastringoptionalFormulaic 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"}'
Response · 200
{ "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}/forecast

The live failure forecast — expected failures per period. Id is in /fleet/forecasts/<id>.

Request
idstring · pathrequiredFleet id.
Response · 200
{
  "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-replacement

Cost-optimal preventive-replacement interval.

Request
distribution_idstringrequirede.g. weibull.
paramsnumber[] | {name,value}[]requiredDistribution parameters.
planned_costnumberrequiredCost of a planned replacement.
unplanned_costnumberrequiredCost of a failure.
unitstringoptionalTime unit for display.
Response · 200
{ "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-finding

Inspection interval that keeps a hidden (protective) function available.

Request
distribution_idstringrequirede.g. exponential.
paramsnumber[] | {name,value}[]requiredDistribution parameters.
target_availabilitynumberrequiredTarget availability in (0,1), e.g. 0.99.
unitstringoptionalTime unit for display.
Response · 200
{ "distribution": "Exponential", "unit": "hours", "mttf": 8760,
  "target_availability": 0.99, "interval": 176.4, "method": "…", "note": "…" }
POST/api/v1/strategy/demonstration-test

Plan a reliability demonstration test (success run, binomial, Weibayes or MTBF).

Request
reliabilitynumberrequiredReliability to show over one mission, in (0,1) (attribute tests).
confidencenumberoptionalConfidence in (0,1), default 0.95.
mission_timenumberoptionalThe mission time; omit to plan in missions.
failuresintoptionalFailures the test allows, default 0.
test_multiplenumberoptionalTest length per unit in missions (needs shape when not 1).
shapenumberoptionalWeibull shape β of the lifetime, assumed known.
unitsintoptionalUnits available: solve for the test time per unit instead.
method / mtbfstring / numberoptionalmethod="mtbf" with an MTBF plans a constant-rate (chi-squared) test.
design_reliabilitynumberoptionalA design's true reliability: its chance of passing.
b_lifenumberoptionalA B-life requirement instead of reliability: 10 for “B10 ≥ mission_time”.
shape_intervalnumber[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.
unitstringoptionalTime unit for display.
Response · 200
{ "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}/usage

Update forecast items' current use, then recompute the forecast and check the fleet's alerts.

Request
name / idcsv colrequiredItem name (or id).
current_usecsv colrequiredAccumulated use so far (the meter reading).
ratecsv coloptionalOptional manual per-period usage rate.
read_atcsv coloptionalWhen 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
Response · 200
{ "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's per_item rows report rate_used and rate_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_fired counts the rules that fired; an alert problem never fails the ingest.
POST/api/ingest/tracking/{fleet_id}/measurements

Append (item, time, value) readings to a tracked fleet and re-predict remaining life.

Request
measurementsobject[]required[{item, time, value}, …] (JSON), or CSV columns item,time,value.
-d '{"measurements": [{"item": "Pump 7", "time": 5300, "value": 6.1}]}'
Response · 200
{ "updated": 1, "items": [ { … } ] }
POST/api/ingest/datasets/{dataset_id}/lives

Append failure rows to a dataset and refit its models in place.

Request
refitbool · queryoptionalDefault true; ?refit=false to skip refitting.
(rows)csv / jsonrequiredRows whose columns match the dataset.
Response · 200
{ "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/models

Create a model from a fit done elsewhere (what reliafy.push wraps).

Request
namestringrequiredModel name.
distributionstringrequiredSurPyval name or Reliafy id.
unitstringoptionalTime unit.
dataobjectoptional{x, c?, n?} arrays — refit into a full model. Provide this or params.
params{name,value}[]optionalParameters for a params-only model.
options / extrasobjectoptionaloffset/zi/lfp (data) or gamma/p/f0 (params).
Response · 200
{ "id": "a1b2…", "name": "Pump bearings", "distribution": "Weibull",
  "params_only": false, "url": "/modelling/m/a1b2…" }