# PUT /api/v1/businesses/{business_id}/cfo-portal/cash-forecast/overrides

> Replace all cash forecast overrides in a scope

- **Tag:** cfo-portal
- **Operation ID:** `cfo_portal_upsert_overrides_api_v1_businesses__business_id__cfo_portal_cash_forecast_overrides_put`

## Description

Atomically replace every override row in the matching scope.

**Request Body:**
- ``version_id``: Optional. If null, replaces the working override
  set; otherwise replaces overrides pinned to that saved version.
- ``overrides``: List of cells to override (week_number / column /
  amount_cents).

**Effect:** All existing overrides in the scope are deleted, then
the provided rows are inserted. Use the empty list to clear the
scope without deleting the URL.

## Authentication

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

## Parameters

- `business_id` (path, string, required)

## Request body

Schema: `CashForecastOverridesUpsert`

- `version_id` (string)
- `overrides` (array · CashForecastOverrideInput) → `CashForecastOverrideInput`
  - `week_number` (integer · required)
  - `column` (string · required) (one of: ar_in, ap_out, inventory, debt, budget_rev, budget_exp, one_time)
  - `amount_cents` (integer)
  - `source` (string) (one of: user, ai)
  - `ai_scenario_label` (string)
  - `note` (string)

## Responses

### 200 — Successful Response

Schema: `CashForecastOverrideList`

- `version_id` (string)
- `items` (array · CashForecastOverride) → `CashForecastOverride`
  - `id` (string · required)
  - `business_id` (string · required)
  - `version_id` (string)
  - `week_number` (integer · required)
  - `column` (string · required) (one of: ar_in, ap_out, inventory, debt, budget_rev, budget_exp, one_time)
  - `override_amount_cents` (integer)
  - `source` (string) (one of: user, ai)
  - `ai_scenario_label` (string)
  - `note` (string)
  - `created_at` (string · date-time · required)
  - `updated_at` (string · date-time · required)

### 400 — Bad Request - Invalid input

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 404 — Not Found - Resource does not exist

### 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 PUT 'https://api.ondayzero.com/api/v1/businesses/{business_id}/cfo-portal/cash-forecast/overrides' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "version_id": "string",
  "overrides": []
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/businesses/{business_id}/cfo-portal/cash-forecast/overrides', {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "version_id": "string",
  "overrides": []
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {
  "version_id": "string",
  "overrides": []
}

response = httpx.put("https://api.ondayzero.com/api/v1/businesses/{business_id}/cfo-portal/cash-forecast/overrides", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/cfo-portal/cfo-portal-upsert-overrides
- OpenAPI slice: https://www.ondayzero.com/docs/reference/cfo-portal/cfo-portal-upsert-overrides/openapi.json
- Other endpoints in **cfo-portal**: https://www.ondayzero.com/docs/reference/cfo-portal
