---
title: "Upload Demand Data"
method: POST
path: "/v1/beam/analyses/{analysis_id}/sink"
tags: ["Analyses"]
---

# Upload Demand Data

`POST /v1/beam/analyses/{analysis_id}/sink`

Beam Analyses support daily or weekly demand data. The type of data is detected automatically on upload.

For **daily** demand the minimum amount of data required is **6 months**, or 180 data points. Beam can impute up 
to 20% of missing values, provided that the minimum data requirements are satisfied and there are no more than 7 
consecutive days missing.

For **weekly** demand the minimum amount of data required is **2 years**, or 104 data points. Beam can impute up 
to 10% of missing values, provided that the minimum data requirements are satisfied and there are no more than 5 
consecutive weeks missing. All weekly data points must align with the **start of the week** and occur on the 
same weekday.

All data points need to be between 2017-01-01 and one year into the future from today's date (today + 365 days).

Uploading data replaces existing data for the same date. It's not currently possible to remove data for a 
particular date. The idea with this endpoint is that you're continuously adding new demand data over time.

The data can be uploaded in chunks, but the analysis data must remain valid at all times. If a newly uploaded 
chunk renders the analysis data invalid (for example, by introducing a large gap between data points), the 
chunk will be rejected, and the previously stored demand data will be preserved.

## Path parameters

- `analysis_id` string, required

## Headers

- `Content-Type` 'text/csv' | 'application/x-ndjson' | 'application/json' | 'application/x-ldjson', required

## Request body

- DemandDataPoint — A single demand data point consisting of a date and a positive numeric demand value.
  - `date` string, date, required — ISO8601 Date format (YYYY-MM-DD)
  - `demand` number, required — Number value (float or integer, must be a positive number).

## Response `202`

Successful Response

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Bearer token scope insufficient
- `404` — Analysis not found
- `409` — Data conflict

---

[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)
