---
title: "Detect anomalies in the last point of the request body"
method: POST
path: "/multivariate/models/{modelId}:detect-last"
---

# Detect anomalies in the last point of the request body

`POST /multivariate/models/{modelId}:detect-last`

Submit a multivariate anomaly detection task with the modelId value of a trained model
and inference data. The inference data should be put into the request body in
JSON format. The request will finish synchronously and return the detection
immediately in the response body.

## Path parameters

- `modelId` string, required

## Request body

- MultivariateMultivariateLastDetectionOptions — Request of the last detection.
  - `variables` MultivariateVariableValues[], required — Contains the inference data, including the name, time stamps (ISO 8601), and values of variables.
    - `variable` string, required — Variable name of the last detection request.
    - `timestamps` string[], required — Time stamps of the last detection request.
    - `values` number[], required — Values of variables.
  - `topContributorCount` integer — Number of top contributed variables for one anomalous time stamp in the response. The default is 10.

## Response `200`

The request has succeeded.

- MultivariateMultivariateLastDetectionResult — Results of the last detection.
  - `variableStates` MultivariateVariableState[] — Variable status.
    - `variable` string — Variable name in variable states.
    - `filledNARatio` number, float — Proportion of missing values that need to be filled by fillNAMethod.
    - `effectiveCount` integer — Number of effective data points before fillNAMethod is applied.
    - `firstTimestamp` string, date-time — First valid time stamp with a value of input data.
    - `lastTimestamp` string, date-time — Last valid time stamp with a value of input data.
  - `results` MultivariateAnomalyState[] — Anomaly status and information.
    - `timestamp` string, date-time, required — Time stamp for this anomaly.
    - `value` MultivariateAnomalyValue — Detailed information of the anomalous time stamp.
      - `isAnomaly` boolean, required — True if an anomaly is detected at the current time stamp.
      - `severity` number, float, required — Indicates the significance of the anomaly. The higher the severity, the more significant the anomaly is.
      - `score` number, float, required — Raw anomaly score of severity, to help indicate the degree of abnormality.
      - `interpretation` MultivariateAnomalyInterpretation[] — Interpretation of this anomalous time stamp.
        - `variable` string — Variable.
        - `contributionScore` number, float — This score shows the percentage that contributes to the anomalous time stamp. It's a number between 0 and 1.
        - `correlationChanges` MultivariateCorrelationChanges — Correlation changes among the anomalous variables.
          - `changedVariables` string[] — Correlated variables that have correlation changes under an anomaly.
    - `errors` MultivariateErrorResponse[] — Error message for the current time stamp.
      - `code` string, required — Error code.
      - `message` string, required — Message that explains the error that the service reported.

## Other responses

- `default` — An unexpected error response.

---

[API](https://skmtc.net/azure/apis/cognitiveservices-anomalydetector.md) · [All operations](https://skmtc.net/azure/apis/cognitiveservices-anomalydetector/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/cognitiveservices-anomalydetector/versions/3d72cecb974e/schema)
