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:predict
scope, 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": true
to 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=true
to include SHAP values in the response (explainability).includeSource=true
to include source data in the response.includeNotPredictedReason=true
to include reasons for rows that could not be predicted.index
to 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
schema
androws
at the root level. - New endpoint: The response contains
schema
androws
inside thedata.attributes
object.
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 yourdeploymentId
andmodelId
are 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
- includeNotPredictedReasonboolean
If true, will include a column with the reason why a prediction was not produced.
- includeShapboolean
If true, the shapley values will be included in the response.
- includeSourceboolean
If true, the source data will be included in the response
- indexstring
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
- deploymentIdstringRequired
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/jsonobject
application/json properties
- rowsarray of arrays
The rows of the dataset to produce predictions from. Date features must be in ISO 8601 format.
- schemaarray of objects
The schema of the input dataset.
schema properties
- namestring
The name of a feature in the dataset.
-
-
Responses
200
Stream of combined prediction output returned successfully.
400
Received a bad argument
- application/jsonobject
application/json properties
- errorsarray of objects
errors properties
- codestringRequired
The unique code for the error
- metaobject
meta properties
- detailsstring
Extra details for what may have caused the error
- errorIdstring
The unique id of the error instance
- argumentstring
The argument
- resourcestring
The resource type that the error occurred on
- resourceIdstring
The resource id that the error occurred on
-
- issuestring
The issue code
- titlestring
A summary of what went wrong
- errorIdstring
The unique id of the error instance
- argumentstring
The argument
- resourcestring
The resource type that the error occurred on
- resourceIdstring
The resource id that the error occurred on
-
-
401
Unauthorized
- application/jsonobject
application/json properties
- errorsarray of objects
errors properties
- codestringRequired
The unique code for the error
- metaobject
meta properties
- detailsstring
Extra details for what may have caused the error
- errorIdstring
The unique id of the error instance
- argumentstring
The argument
- resourcestring
The resource type that the error occurred on
- resourceIdstring
The resource id that the error occurred on
-
- issuestring
The issue code
- titlestring
A summary of what went wrong
- errorIdstring
The unique id of the error instance
- argumentstring
The argument
- resourcestring
The resource type that the error occurred on
- resourceIdstring
The resource id that the error occurred on
-
-
403
Access forbidden
- application/jsonobject
application/json properties
- errorsarray of objects
errors properties
- codestringRequired
The unique code for the error
- metaobject
meta properties
- detailsstring
Extra details for what may have caused the error
- errorIdstring
The unique id of the error instance
- argumentstring
The argument
- resourcestring
The resource type that the error occurred on
- resourceIdstring
The resource id that the error occurred on
-
- issuestring
The issue code
- titlestring
A summary of what went wrong
- errorIdstring
The unique id of the error instance
- argumentstring
The argument
- resourcestring
The resource type that the error occurred on
- resourceIdstring
The resource id that the error occurred on
-
-
404
Resource not found.
- application/jsonobject
application/json properties
- errorsarray of objects
errors properties
- codestringRequired
The unique code for the error
- metaobject
meta properties
- detailsstring
Extra details for what may have caused the error
- errorIdstring
The unique id of the error instance
- argumentstring
The argument
- resourcestring
The resource type that the error occurred on
- resourceIdstring
The resource id that the error occurred on
-
- issuestring
The issue code
- titlestring
A summary of what went wrong
- errorIdstring
The unique id of the error instance
- argumentstring
The argument
- resourcestring
The resource type that the error occurred on
- resourceIdstring
The resource id that the error occurred on
-
-
409
Resource conflict
- application/jsonobject
application/json properties
- errorsarray of objects
errors properties
- codestringRequired
The unique code for the error
- metaobject
meta properties
- detailsstring
Extra details for what may have caused the error
- errorIdstring
The unique id of the error instance
- argumentstring
The argument
- resourcestring
The resource type that the error occurred on
- resourceIdstring
The resource id that the error occurred on
-
- issuestring
The issue code
- titlestring
A summary of what went wrong
- errorIdstring
The unique id of the error instance
- argumentstring
The argument
- resourcestring
The resource type that the error occurred on
- resourceIdstring
The resource id that the error occurred on
-
-
503
Resource unavailable
- application/jsonobject
application/json properties
- errorsarray of objects
errors properties
- codestringRequired
The unique code for the error
- metaobject
meta properties
- detailsstring
Extra details for what may have caused the error
- errorIdstring
The unique id of the error instance
- argumentstring
The argument
- resourcestring
The resource type that the error occurred on
- resourceIdstring
The resource id that the error occurred on
-
- issuestring
The issue code
- titlestring
A summary of what went wrong
- errorIdstring
The unique id of the error instance
- argumentstring
The argument
- resourcestring
The resource type that the error occurred on
- resourceIdstring
The resource id that the error occurred on
-
-
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({ hostConfig: { host: 'https://your-tenant.us.qlikcloud.com', apiKey: '<access-token>', },})
await qlik.automlDeployments.createAutomlDeploymentRealtimePrediction( 'c35f4b70-3ce4-4a30-b62b-2aef16943bc4', {}, { rows: [['string']], schema: [{ name: 'string' }], },)
This API is not included yet in qlik-cli
curl "https://your-tenant.us.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"}]}'