---
title: "Create Model"
method: POST
path: "/v1/forecasts/models"
tags: ["Models"]
---

# Create Model

`POST /v1/forecasts/models`

Creates a new forecast model. You must provide a `name` and a `location` (via a Saved Location ID). Optionally specify `demand_type`, `label`, `external_id`, `forecast_window`, `algo`, and `generate_baseline`.

After creating a model, upload historical demand data using the Create Demand Data endpoint, then trigger training.

## Request body

- CreateModelRequest
  - `name` string, required — Name for the forecast model.
  - `external_id` string — 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_window` '1d' | '7d' | '14d' | '28d' | '30d' | '60d' | '90d'
  - `generate_baseline` boolean — When `true`, generates a baseline model using historical demand data only - without PredictHQ demand intelligence - for benchmarking accuracy against the enhanced model.
  - `label` string[] — Set of labels you can use to better identify or group your forecast models.
  - `location` Location, required — Location of the Analysis. Supports one of the following location options: - `saved_location_id` - `geopoint` with `radius` and `unit`
    - `geopoint` GeoPoint — Contains `lat` and `lon` coordinates for your analysis, e.g. if you are creating an analysis for a store in Seattle you'd specify the latitude and longitude of your store.
      - `lat` string, required — Latitude coordinate as a decimal number between -90 and 90.
      - `lon` string, required — Longitude coordinate as a decimal number between -180 and 180.
    - `radius` number — Must be an integer or a float number up to 2 decimal places. It represents the radius of the event search around your `geopoint` to use for time series modelling and correlation. We **strongly recommend** using the [Suggested Radius API](https://docs.predicthq.com/api/suggested-radius/get-suggested-radius) to find a suitable radius for your location/industry.
    - `unit` 'm' | 'mi' | 'km' | 'ft' — The unit for `radius` where - `m` is meters - `km` is kilometers - `ft` is feet - `mi` is miles
    - `saved_location_id` string — The ID of a previously created Saved Location for your analysis as documented at [Saved Locations API](https://docs.predicthq.com/api/saved-locations/create-a-saved-location)
  - `algo` 'phq-xgboost' — Currently we offer one algorithm based on XGBoost. In the future we may offer additional algos.
  - `demand_type` InputDemandType
    - `interval` 'day'
    - `industry` 'accommodation' | 'cpg' | 'tourism' | 'marketing' | 'parking' | 'restaurants' | 'retail' | 'transportation' | 'other' — The industry of the demand data being analysed by Beam. Choosing the right `industry` is important as this will determine the type of features used in the Analysis and will impact the accuracy of the results.

## Response `201`

Successful Response

- CreateModelResponse
  - `errors` string[] — List of error messages, if any.
  - `warnings` string[] — List of warning messages, if any.
  - `model_id` string, required — Unique identifier for the newly created forecast model.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `402` — Payment Required
- `403` — Forbidden

---

[API](https://skmtc.net/predicthq/apis/predicthq-events-api.md) · [All operations](https://skmtc.net/predicthq/apis/predicthq-events-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/predicthq/predicthq-events-api/revisions/66cd8ff349dd/schema)
