Payload

The request body should be passed using the -d option in the cURL command. Replace [data] with the actual JSON-formatted content you want to send for prediction. The structure and required fields depend on the specific model’s configuration. (See the next section for details.)

The v1 request body uses a structured format built from nested arrays of objects. Each object represents a feature (column) and contains two keys:

  • "alias": the name of the input column as defined during model training

  • "selectedValue": the value you are submitting for prediction

This format is often used when data is being prepared manually or when values are mapped from UI elements.


v1 Example - Binary Classification / Multiclass Classification / Regression)

{
  "data": {
    "predict_values": [
      [
        { "alias": "Lead Source", "selectedValue": "bing" },
        { "alias": "Lead Origin", "selectedValue": "API" },
        { "alias": "Converted", "selectedValue": "YES" }
      ],
      [
        { "alias": "Lead Source", "selectedValue": "Google" },
        { "alias": "Lead Origin", "selectedValue": "Landing Page Submission" },
        { "alias": "Converted", "selectedValue": "YES" }
      ],
      [
        { "alias": "Lead Source", "selectedValue": "Olark Chat" },
        { "alias": "Lead Origin", "selectedValue": "API" },
        { "alias": "Converted", "selectedValue": "YES" }
      ]
    ]
  }
}

v1 Example (Timeseries)

{
  "data": {
    "predict_values": {
      "startDate": "2023-04-17",
      "endDate": "2023-04-18",
      "sequenceID": "A"
    }
  }
}

For time series forecasting, the structure differs from classification and regression models.

  • startDate and endDate: define the prediction period

  • sequenceID: identifies the specific time series to forecast (e.g., a product, store, or region)

JSON structure represents a data object with a key "data" mapping to an object called "predict_values". The "predict_values" object contains three key-value pairs. The required keys are "startDate", "endDate", and "sequenceID", and their corresponding values are "2025-04-17", "2025-04-18", and "A" respectively.

Last updated

Was this helpful?

#76: New tutorial for Timeseries

Change request updated