# POST /api/v1/budgets/forecast/configs

> Create forecast config

- **Tag:** budgets
- **Operation ID:** `create_forecast_config_api_v1_budgets_forecast_configs_post`

## Description

Save a forecast configuration for reuse.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Request body

Schema: `ForecastConfigCreateRequest`

- `name` (string · required) — Forecast configuration name.
- `method` (ForecastMethodEnum) → `ForecastMethodEnum` — Forecasting method to use.
- `lookback_months` (integer) — Historical months to analyze.
- `forecast_months` (integer) — Months to forecast into future.
- `growth_rate_percent` (integer) — Annual growth rate adjustment (%).
- `use_seasonality` (boolean) — Apply seasonal adjustments.
- `notes` (string) — Configuration notes.

## Responses

### 201 — Successful Response

Schema: `ForecastConfigResponse`

- `id` (string · required) — Config UUID.
- `name` (string · required) — Config name.
- `method` (ForecastMethodEnum · required) → `ForecastMethodEnum` — Forecasting method.
- `lookback_months` (integer · required) — Historical months analyzed.
- `forecast_months` (integer · required) — Months forecasted.
- `growth_rate_percent` (integer · required) — Growth rate adjustment.
- `use_seasonality` (boolean · required) — Seasonality enabled.
- `is_active` (boolean · required) — Whether config is active.
- `notes` (string) — Notes.
- `business_id` (string · required) — Business UUID.
- `created_at` (string · date-time · required) — Creation timestamp.
- `updated_at` (string · date-time · required) — Last update timestamp.

### 400 — Bad Request - Invalid input

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X POST 'https://api.ondayzero.com/api/v1/budgets/forecast/configs' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/budgets/forecast/configs', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "string"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

payload = {
  "name": "string"
}

response = httpx.post("https://api.ondayzero.com/api/v1/budgets/forecast/configs", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/budgets/create-forecast-config
- OpenAPI slice: https://www.ondayzero.com/docs/reference/budgets/create-forecast-config/openapi.json
- Other endpoints in **budgets**: https://www.ondayzero.com/docs/reference/budgets
