Create Model
Create a forecast model.
Authorizations
Body
namestring · min: 1Required
Name for the forecast model.
external_idstring · min: 1Optional
External identifier for the forecast model. If you have an ID for the location/store/property/product-group in your other platforms, use the same ID here to easily connect this specific forecast model.
forecast_windowstring · enumOptionalPossible values: 
Number of days into the future to forecast.
labelstring[] · min: 1Optional
Set of labels you can use to better identify or group your forecast models.
algostring · enumOptionalDefault: 
Currently we offer one algorithm based on XGBoost. In the future we may offer additional algos.
phq-xgboostPossible values: Responses
201
Successful Response
application/json
422
Validation Error
application/json
post
/v1/forecasts/modelsPOST /v1/forecasts/models HTTP/1.1
Host: api.predicthq.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 197
{
  "name": "text",
  "external_id": "text",
  "forecast_window": "1d",
  "label": [
    "text"
  ],
  "location": {
    "saved_location_id": "text"
  },
  "algo": "phq-xgboost",
  "demand_type": {
    "interval": "day",
    "industry": "accommodation"
  }
}{
  "errors": [
    "text"
  ],
  "warnings": [
    "text"
  ],
  "model_id": "text"
}OpenAPI Spec
The OpenAPI spec for Forecasts API can be found here.
Guides
Last updated
Was this helpful?