---
title: "Checks model health for the given model id"
method: POST
path: "/model/modelhealth/{ForecastModelId}"
tags: ["ForecastModel"]
---

# Checks model health for the given model id

`POST /model/modelhealth/{ForecastModelId}`

The forecast model id must be a locked model of the type segmented or multivariate

## Path parameters

- `ForecastModelId` string, uuid, required

## Request body

- ForecastModelHealth
  - `runModelHealthNow` boolean — This field give the user the ability to ‘remotely press’ the ‘check model health now’ button in the app to get the latest model health results. The default operation for this input will be to NOT ‘check model health now’. When the default value of false (don’t run model health now) is replaced with a value of true (run model health now), the equivalent of depressing the green button in the app will be triggered.
  - `referenceTable` ControlChartPoint[], nullable
    - `rule1_major_outlier` number, double, nullable — Populated with the value of the residual IF rule 1 is violated.If no violation is found, the value will be missing.
    - `rule2_9pos_inarow` number, double, nullable — Populated with the value of the residual IF rule 2 is violated.If no violation is found, the value will be missing.
    - `rule3_6_trend` number, double, nullable — Populated with the value of the residual IF rule 3 is violated.If no violation is found, the value will be missing.
    - `rule4_14_up_and_down` number, double, nullable — Populated with the value of the residual IF rule 4 is violated.If no violation is found, the value will be missing.
    - `rule5_2_out_of_3` number, double, nullable — Populated with the value of the residual IF rule 5 is violated.If no violation is found, the value will be missing.
    - `rule6_4_out_of_5` number, double, nullable — Populated with the value of the residual IF rule 6 is violated.If no violation is found, the value will be missing.
    - `rule7_15_stay_within_1std` number, double, nullable — Populated with the value of the residual IF rule 7 is violated.If no violation is found, the value will be missing.
    - `rule8_8stay_out_1std` number, double, nullable — Populated with the value of the residual IF rule 8 is violated.If no violation is found, the value will be missing.
    - `model_decay` number, double, nullable — Model Decay value calculated by the macro
    - `dateString` string, nullable — The authoritative calendar date for this point (e.g. "2024-02-01").

## Response `200`

OK

- ModelHealthResponse
  - `result` ControlChartResult
    - `controlChartPoints` ControlChartPoint[], nullable
      - `rule1_major_outlier` number, double, nullable — Populated with the value of the residual IF rule 1 is violated.If no violation is found, the value will be missing.
      - `rule2_9pos_inarow` number, double, nullable — Populated with the value of the residual IF rule 2 is violated.If no violation is found, the value will be missing.
      - `rule3_6_trend` number, double, nullable — Populated with the value of the residual IF rule 3 is violated.If no violation is found, the value will be missing.
      - `rule4_14_up_and_down` number, double, nullable — Populated with the value of the residual IF rule 4 is violated.If no violation is found, the value will be missing.
      - `rule5_2_out_of_3` number, double, nullable — Populated with the value of the residual IF rule 5 is violated.If no violation is found, the value will be missing.
      - `rule6_4_out_of_5` number, double, nullable — Populated with the value of the residual IF rule 6 is violated.If no violation is found, the value will be missing.
      - `rule7_15_stay_within_1std` number, double, nullable — Populated with the value of the residual IF rule 7 is violated.If no violation is found, the value will be missing.
      - `rule8_8stay_out_1std` number, double, nullable — Populated with the value of the residual IF rule 8 is violated.If no violation is found, the value will be missing.
      - `model_decay` number, double, nullable — Model Decay value calculated by the macro
      - `dateString` string, nullable — The authoritative calendar date for this point (e.g. "2024-02-01").
    - `controlChartErrors` ControlChartErrors
      - `error_flag` number, double, nullable
      - `error_text` string, nullable
    - `controlChartMeta` ControlChartMeta
      - `average_residual` number, double, nullable — Average Residual Calculated by the control chart. Should always be zero
      - `ucl3` number, double, nullable — Upper Control Limit 3- This is 3 standard deviations above the mean and will be the value of one of the control lines in the chart in the app. Calculation: Average_Resid + 3 * stand_dev_resid.
      - `standard_dev_resid` number, double, nullable — Standard Deviation of the Residuals calculated by the control chart.Used to calculate the control limits
      - `lcl3` number, double, nullable — Lower Control Limit 3- This is 3 standard deviations below the mean and will be the value of one of the control lines in the chart in the app. Calculation: Average_Resid - 3 * stand_dev_resid.
      - `ucl2` number, double, nullable — Upper Control Limit 2- This is 2 standard deviations above the mean and will be the value of one of the control lines in the chart in the app. Calculation: Average_Resid + 2 * stand_dev_resid.
      - `lcl2` number, double, nullable — Lower Control Limit 2- This is 2 standard deviations below the mean and will be the value of one of the control lines in the chart in the app. Calculation: Average_Resid - 2 * stand_dev_resid.
      - `ucl1` number, double, nullable — Upper Control Limit 1- This is 1 standard deviations above the mean and will be the value of one of the control lines in the chart in the app. Calculation: Average_Resid + 1 * stand_dev_resid.
      - `lcl1` number, double, nullable — Lower Control Limit 1- This is 1 standard deviations below the mean and will be the value of one of the control lines in the chart in the app. Calculation: Average_Resid - 1 * stand_dev_resid.
      - `total_violations` number, double, nullable — Total Number of violations found in the input dataset residuals
      - `plot_rule1_major_outlier` number, double, nullable — Flags used as switches in the control chart macro to determine if violation type needs to be plotted in the chart. If so, 'PLOT_RULE1_MAJOR_OUTLIER' will be set to one, otherwise it will be zero.
      - `plot_rule2_9pos_inarow` number, double, nullable — Flags used as switches in the control chart macro to determine if violation type needs to be plotted in the chart. If so, 'PLOT_RULE2_9POS_INAROW' will be set to one, otherwise it will be zero.
      - `plot_rule3_6_trend` number, double, nullable — Flags used as switches in the control chart macro to determine if violation type needs to be plotted in the chart. If so, 'PLOT_RULE3_6_TREND' will be set to one, otherwise it will be zero.
      - `plot_rule4_14_up_and_down` number, double, nullable — Flags used as switches in the control chart macro to determine if violation type needs to be plotted in the chart. If so, 'PLOT_RULE4_14_UP_AND_DOWN' will be set to one, otherwise it will be zero.
      - `plot_rule7_15_stay_within_1std` number, double, nullable — Flags used as switches in the control chart macro to determine if violation type needs to be plotted in the chart. If so, 'PLOT_RULE7_15_STAY_WITHIN_1STD' will be set to one, otherwise it will be zero.
      - `plot_rule5_2_out_of_3` number, double, nullable — Flags used as switches in the control chart macro to determine if violation type needs to be plotted in the chart. If so, 'PLOT_RULE5_2_OUT_OF_3' will be set to one, otherwise it will be zero.
      - `plot_rule6_4_out_of_5` number, double, nullable — Flags used as switches in the control chart macro to determine if violation type needs to be plotted in the chart. If so, 'PLOT_RULE6_4_OUT_OF_5' will be set to one, otherwise it will be zero.
      - `plot_rule8_8stay_out_1std` number, double, nullable — Flags used as switches in the control chart macro to determine if violation type needs to be plotted in the chart. If so, 'PLOT_RULE8_8STAY_OUT_1STD' will be set to one, otherwise it will be zero.
      - `model_decay_chart_cntrol_std` string, nullable — The standard deviation used to calculate the model decay metric control limits.We are still playing with this setting.
      - `model_decay_ucl` string, nullable — Upper Control Limit for the model decay metric.This is calculated by the control chart using the model score and is based off of the Prevedere simulator data.
      - `model_decay_lcl` string, nullable — Lower Control Limit for the model decay metric. This is calculated by the control chart using the model score and is based off of the Prevedere simulator data.
      - `model_decay_mov_avg_n` string, nullable — The moving average setting used in the calculation of model decay.Null for usage 2 right now. This might change.
      - `model_score2` string, nullable — The value of model_score2 that was received by the control chart macro.This is used in calculating the model MODEL_DECAY_LCL and MODEL_DECAY_UCL values.Higher scoring models have tighter expected control limits.
      - `alt_xref_date` string, nullable — Null for Usage 2
      - `data_level` string, nullable — Not required for Usage two- This is the level of the data received by the control chart macro as submitted to the control chart macro.
    - `controlChartPrescription` ControlChartPrescription
      - `type` string, nullable
      - `prescription` string, nullable
      - `event` string, nullable
      - `description` string, nullable
      - `date` number, double, nullable
    - `controlChartInsights` ControlChartPrescription[], nullable
      - `type` string, nullable
      - `prescription` string, nullable
      - `event` string, nullable
      - `description` string, nullable
      - `date` number, double, nullable
  - `modelHealthScoreAtPublish` number, double
  - `projectId` string, uuid
  - `modelId` string, uuid
  - `modelType` string, nullable
  - `instanceCode` string, nullable
  - `url` string, nullable

## Other responses

- `400` — Bad Request
- `404` — Not Found
- `422` — Model is expired or in a non-production state
- `429` — If the user has sent too many requests

---

[API](https://skmtc.net/prevedere/apis/board-foresight-api-v1.md) · [All operations](https://skmtc.net/prevedere/apis/board-foresight-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/prevedere/board-foresight-api-v1/revisions/c5ac8232e334/schema)
