For the complete documentation index, see llms.txt. This page is also available as Markdown.

Update model

Update an existing forecast model.

Update Model

patch

Partially updates an existing forecast model. Only the fields provided in the request body will be changed. Changes to location, demand_type, forecast_window, algo, or generate_baseline are blocked while the model is in preparing, training, or forecasting status. Changing any of those fields sets the model to stale status, requiring re-training to take effect.

Authorizations
AuthorizationstringRequired

Enter your PredictHQ API key. The Bearer prefix is added automatically.

When calling the API directly, send: Authorization: Bearer <YOUR_API_KEY> as documented at https://docs.predicthq.com/api/overview/authenticating

Path parameters
model_idstringRequired

The unique identifier of the forecast model.

Body
namestring · min: 1 · nullableOptional

Name for the forecast model.

external_idstring · min: 1 · nullableOptional

User-provided external identifier for cross-referencing with other systems.

forecast_windowstring · enum · nullableOptional

Number of days into the future to forecast.

Possible values:
generate_baselinebooleanOptional

When true, generates a baseline model using historical demand data only - without PredictHQ demand intelligence - for benchmarking accuracy against the enhanced model.

Default: false
labelstring[] · min: 1 · nullableOptional

Set of labels you can use to better identify or group your forecast models.

algoconst: phq-xgboost · nullableOptional

Algorithm to use for forecasting.

Responses
204

Successful Response

No content

patch/v1/forecasts/models/{model_id}
PATCH /v1/forecasts/models/{model_id} HTTP/1.1
Host: api.predicthq.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 217

{
  "name": "text",
  "external_id": "text",
  "forecast_window": "1d",
  "generate_baseline": false,
  "label": [
    "text"
  ],
  "location": {
    "saved_location_id": "text"
  },
  "algo": "text",
  "demand_type": {
    "interval": "text",
    "industry": "accommodation"
  }
}

No content

OpenAPI Spec

The OpenAPI spec for Forecasts API can be found here.

Guides

Last updated

Was this helpful?