AutoML real-time predictions
Use your ML deployment to generate real-time results returned as JSON in a synchronous manner to predict future outcomes on new data.
This API is deprecated and will be removed on or after February 3, 2026. The complete end-to-end machine learning capability is now available in the Machine Learning API.
Migrate from the AutoML real-time predictions API to the Machine Learning API
This step-by-step guide helps you migrate your application from the deprecated AutoML real-time predictions to the new real-time prediction endpoint in the Machine Learning API.
Using the Machine Learning API, you can now add multiple models to a deployment. A system of aliases is used in deployments to allow for dynamic swapping of models for use in predictions. For more information, see Using multiple models in your ML deployment on Qlik Help.
Understand the endpoint changes
The new real-time prediction endpoint in the Machine Learning API replaces the deprecated AutoML real-time predictions endpoint.
The main change is the response format: responses are now wrapped under data.attributes.
The request body format is unchanged.
Here’s how your requests will change:
| Deprecated endpoint | New endpoint | |
|---|---|---|
| URL | /api/v1/automl-deployments/{deploymentId}/realtime-predictions | /api/v1/ml/deployments/{deploymentId}/realtime-predictions/actions/run |
| Response body | schema and rows at the root level | schema and rows wrapped under data.attributes |
Aliases are a Machine Learning API feature and do not require migration.
Example response from the deprecated endpoint:
{ "schema": [ { "name": "feature_1", "type": "numeric" }, { "name": "feature_4_predicted", "type": "categorical" }, { "name": "feature_4_no", "type": "numeric" }, { "name": "feature_4_yes", "type": "numeric" }, { "name": "not_predicted_reason", "type": "categorical" } ], "rows": [ [0, "yes", 0.50, 0.49, null], [1, "no", 0.76, 0.23, null] ]}Example response from the new endpoint:
{ "data": { "type": "realtime-prediction", "attributes": { "schema": [ { "name": "feature_1", "type": "numeric" }, { "name": "feature_4_predicted", "type": "categorical" }, { "name": "feature_4_no", "type": "numeric" }, { "name": "feature_4_yes", "type": "numeric" }, { "name": "not_predicted_reason", "type": "categorical" } ], "rows": [ [0, "yes", 0.50, 0.49, null], [1, "no", 0.76, 0.23, null] ] } }}Prerequisites
Before you begin, make sure you have:
- API credentials with permission to access the Machine Learning API endpoints.
For more information, see Authentication.
Required permissions and scopes
If you use an API key: The user or service account must be assigned the Automl Deployment Contributor role to call the real-time prediction endpoint.
If you use OAuth: Your token must include theautoml-deployments:predictscope, which enables the required permissions for the real-time prediction endpoint. - A deployed and activated model for making predictions.
- Your deployment must be created with
"enablePredictions": trueto allow real-time predictions. - Your model must be activated on the deployment using
POST /ml/deployments/{deploymentId}/actions/activate-models.
- Your deployment must be created with
- The
deploymentId: The unique identifier for your deployment.
If you’re only migrating and your application already sends requests with the correct
schema and rows, you can skip this. The migration only changes the response format. Request bodies are
unchanged.
If you need to discover the input schema (for example, for a newly deployed model), retrieve the experiment
version and use the returned featuresList as the canonical source for feature names, order, and types.
For endpoints and examples that show how to fetch the
featuresList, see the Machine Learning API reference.
Make a real-time prediction request
Once your model is activated, and you have the required input schema, you can make predictions using the new real-time prediction endpoint in the Machine Learning API.
Send a real-time prediction request with a request body that includes the schema and rows that match the features
expected by your model.
Example request
curl -X POST "https://<TENANT_URL>/api/v1/ml/deployments/{deploymentId}/realtime-predictions/actions/run" \ -H "Authorization: Bearer {TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "schema": [ {"name": "feature_1"}, {"name": "feature_2"}, {"name": "feature_3"}, {"name": "feature_4"} ], "rows": [ [0, "France", 5, "yes"], [1, "Germany", 20, "no"] ] }'(Optional) Add query parameters:
includeShap=trueto include SHAP values in the response (explainability).includeSource=trueto include source data in the response.includeNotPredictedReason=trueto include reasons for rows that could not be predicted.indexto specify the name of the feature in the source data to use as an index in the response data.
Example request with SHAP values
curl -X POST "https://<TENANT_URL>/api/v1/ml/deployments/{deploymentId}/realtime-predictions/actions/run?includeShap=true" \ -H "Authorization: Bearer {TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "schema": [ {"name": "feature_1"}, {"name": "feature_2"}, {"name": "feature_3"}, {"name": "feature_4"} ], "rows": [ [0, "France", 5, "yes"], [1, "Germany", 20, "no"] ] }'Verify the response
If your request is successful, you’ll receive a JSON response like this:
{ "data": { "type": "realtime-prediction", "attributes": { "schema": [ { "name": "feature_1", "type": "numeric" }, { "name": "feature_4_predicted", "type": "categorical" }, { "name": "feature_4_no", "type": "numeric" }, { "name": "feature_4_yes", "type": "numeric" }, { "name": "not_predicted_reason", "type": "categorical" } ], "rows": [ [0, "yes", 0.50, 0.49, null], [1, "no", 0.76, 0.23, null] ] } }}The response format differs between the deprecated and new endpoints:
- Deprecated endpoint: The response contains
schemaandrowsat the root level. - New endpoint: The response contains
schemaandrowsinside thedata.attributesobject.
If your code previously read resp.schema and resp.rows, update it to resp.data.attributes.schema and
resp.data.attributes.rows.
Troubleshooting
If you get an error, see the following common issues:
401 Unauthorized: Verify your API credentials and permissions.404 Not Found: Make sure yourdeploymentIdandmodelIdare correct, and your model is deployed and activated.400 Bad Request: Verify your request body for correct schema and data types.
For more information, see the Machine Learning API reference.
Endpoints
Generates predictions in a synchronous request and response.
Facts
Query Parameters
- includeNotPredictedReason boolean
If true, will include a column with the reason why a prediction was not produced.
- includeShap boolean
If true, the shapley values will be included in the response.
- includeSource boolean
If true, the source data will be included in the response
- index string
The name of the feature in the source data to use as an index in the response data. The column will be included with its original name and values. This is intended to allow the caller to join results with source data.
Path Parameters
- deploymentId stringRequired
The ID of the ML deployed model that will be employed to produce predictions.
Request Body
Request payload containing the dataset for predictions. Date features must be in ISO 8601 format.
- application/json object
application/json properties
- rows array of arrays
The rows of the dataset to produce predictions from. Date features must be in ISO 8601 format.
- schema array of objects
The schema of the input dataset.
schema properties
- name string
The name of a feature in the dataset.
-
-
Responses
200
Stream of combined prediction output returned successfully.
400
Received a bad argument
- application/json object
application/json properties
- errors array of objects
errors properties
- code stringRequired
The unique code for the error
- meta object
meta properties
- details string
Extra details for what may have caused the error
- errorId string
The unique id of the error instance
- argument string
The argument
- resource string
The resource type that the error occurred on
- resourceId string
The resource id that the error occurred on
-
- issue string
The issue code
- title string
A summary of what went wrong
- errorId string
The unique id of the error instance
- argument string
The argument
- resource string
The resource type that the error occurred on
- resourceId string
The resource id that the error occurred on
-
-
401
Unauthorized
- application/json object
application/json properties
- errors array of objects
errors properties
- code stringRequired
The unique code for the error
- meta object
meta properties
- details string
Extra details for what may have caused the error
- errorId string
The unique id of the error instance
- argument string
The argument
- resource string
The resource type that the error occurred on
- resourceId string
The resource id that the error occurred on
-
- issue string
The issue code
- title string
A summary of what went wrong
- errorId string
The unique id of the error instance
- argument string
The argument
- resource string
The resource type that the error occurred on
- resourceId string
The resource id that the error occurred on
-
-
403
Access forbidden
- application/json object
application/json properties
- errors array of objects
errors properties
- code stringRequired
The unique code for the error
- meta object
meta properties
- details string
Extra details for what may have caused the error
- errorId string
The unique id of the error instance
- argument string
The argument
- resource string
The resource type that the error occurred on
- resourceId string
The resource id that the error occurred on
-
- issue string
The issue code
- title string
A summary of what went wrong
- errorId string
The unique id of the error instance
- argument string
The argument
- resource string
The resource type that the error occurred on
- resourceId string
The resource id that the error occurred on
-
-
404
Resource not found.
- application/json object
application/json properties
- errors array of objects
errors properties
- code stringRequired
The unique code for the error
- meta object
meta properties
- details string
Extra details for what may have caused the error
- errorId string
The unique id of the error instance
- argument string
The argument
- resource string
The resource type that the error occurred on
- resourceId string
The resource id that the error occurred on
-
- issue string
The issue code
- title string
A summary of what went wrong
- errorId string
The unique id of the error instance
- argument string
The argument
- resource string
The resource type that the error occurred on
- resourceId string
The resource id that the error occurred on
-
-
409
Resource conflict
- application/json object
application/json properties
- errors array of objects
errors properties
- code stringRequired
The unique code for the error
- meta object
meta properties
- details string
Extra details for what may have caused the error
- errorId string
The unique id of the error instance
- argument string
The argument
- resource string
The resource type that the error occurred on
- resourceId string
The resource id that the error occurred on
-
- issue string
The issue code
- title string
A summary of what went wrong
- errorId string
The unique id of the error instance
- argument string
The argument
- resource string
The resource type that the error occurred on
- resourceId string
The resource id that the error occurred on
-
-
503
Resource unavailable
- application/json object
application/json properties
- errors array of objects
errors properties
- code stringRequired
The unique code for the error
- meta object
meta properties
- details string
Extra details for what may have caused the error
- errorId string
The unique id of the error instance
- argument string
The argument
- resource string
The resource type that the error occurred on
- resourceId string
The resource id that the error occurred on
-
- issue string
The issue code
- title string
A summary of what went wrong
- errorId string
The unique id of the error instance
- argument string
The argument
- resource string
The resource type that the error occurred on
- resourceId string
The resource id that the error occurred on
-
-
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({ hostConfig: { host: 'https://{tenant}.{region}.qlikcloud.com', apiKey: '<access-token>', },})
await qlik.automlDeployments.createAutomlDeploymentRealtimePrediction( 'c35f4b70-3ce4-4a30-b62b-2aef16943bc4', {}, { rows: [['string']], schema: [{ name: 'string' }], },)# qlik-cli has not implemented support for POST /api/v1/automl-deployments/{deploymentId}/realtime-predictions yet.curl "https://{tenant}.{region}.qlikcloud.com/api/v1/automl-deployments/{deploymentId}/realtime-predictions" \-X POST \-H "Content-type: application/json" \-H "Authorization: Bearer <access_token>" \-d '{"rows":[["string"]],"schema":[{"name":"string"}]}'