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

Upload Demand Data

Upload historical demand data for an existing forecast model.

Create Model Demand

post

Uploads historical demand data for a forecast model. The model must exist and belong to the authenticated organization.

You can use any of the following content types:

  • application/json: A JSON object with a demand array of {date, demand} objects.

  • text/csv: A CSV file with lowercase headers date,demand and one row per data point.

  • application/x-ndjson: Newline-delimited JSON where each line is a {date, demand} object.

The date field should be in YYYY-MM-DD format and demand must be a non-negative number.

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.

Header parameters
Content-Typestring · enumRequired

Content type of the uploaded payload.

Example: application/jsonPossible values:
Body
Responses
201

Successful Response

No content

post/v1/forecasts/models/{model_id}/demand
POST /v1/forecasts/models/{model_id}/demand HTTP/1.1
Host: api.predicthq.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 45

{
  "demand": [
    {
      "demand": 1,
      "date": "2026-01-01"
    }
  ]
}

No content

OpenAPI Spec

The OpenAPI spec for Forecasts API can be found here.

Guides

Last updated

Was this helpful?