# PATCH /api/v1/cfo-projection/scenarios/{scenario_id}

> Update scenario

- **Tag:** cfo-projection
- **Operation ID:** `update_scenario_api_v1_cfo_projection_scenarios__scenario_id__patch`

## Description

Partial update of scenario drivers.

## Authentication

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

## Parameters

- `scenario_id` (path, string, required)

## Request body

Schema: `ScenarioUpdateRequest`

- `name` (string)
- `projection_months` (integer)
- `revenue_drivers` (object)
- `cost_classifications` (object)
- `variable_drivers` (object)
- `fixed_drivers` (object)
- `monthly_overrides` (object) — Manual monthly overrides keyed by ledger_id then month index
- `tax_rate` (number)
- `interest_income_monthly` (integer)
- `interest_expense_monthly` (integer)

## Responses

### 200 — Successful Response

Schema: `ScenarioResponse`

- `id` (string · required)
- `business_id` (string · required)
- `name` (string · required)
- `is_active` (boolean · required)
- `base_month` (string · date · required)
- `projection_months` (integer · required)
- `revenue_drivers` (object)
- `cost_classifications` (object)
- `variable_drivers` (object)
- `fixed_drivers` (object)
- `monthly_overrides` (object)
- `tax_rate` (number · required)
- `interest_income_monthly` (integer · required)
- `interest_expense_monthly` (integer · required)
- `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 PATCH 'https://api.ondayzero.com/api/v1/cfo-projection/scenarios/{scenario_id}' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "projection_months": 0,
  "revenue_drivers": {},
  "cost_classifications": {},
  "variable_drivers": {},
  "fixed_drivers": {}
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/cfo-projection/scenarios/{scenario_id}', {
  method: 'PATCH',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "string",
  "projection_months": 0,
  "revenue_drivers": {},
  "cost_classifications": {},
  "variable_drivers": {},
  "fixed_drivers": {}
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {
  "name": "string",
  "projection_months": 0,
  "revenue_drivers": {},
  "cost_classifications": {},
  "variable_drivers": {},
  "fixed_drivers": {}
}

response = httpx.patch("https://api.ondayzero.com/api/v1/cfo-projection/scenarios/{scenario_id}", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/cfo-projection/update-scenario
- OpenAPI slice: https://www.ondayzero.com/docs/reference/cfo-projection/update-scenario/openapi.json
- Other endpoints in **cfo-projection**: https://www.ondayzero.com/docs/reference/cfo-projection
