# PATCH /api/v1/budgets/{budget_id}

> Update budget

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

## Description

Update a draft budget's metadata.

## Authentication

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

## Parameters

- `budget_id` (path, string, required)

## Request body

Schema: `BudgetUpdateRequest`

- `name` (string) — Budget name.
- `description` (string) — Budget description.
- `notes` (string) — Additional notes.
- `start_date` (string · date) — Budget period start date.
- `end_date` (string · date) — Budget period end date.

## Responses

### 200 — Successful Response

Schema: `SuccessEnvelope_BudgetResponse_`

- `success` (boolean)
- `message` (string)
- `code` (string)
- `data` (BudgetResponse)

### 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/budgets/{budget_id}' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "description": "string",
  "notes": "string",
  "start_date": "2026-01-01",
  "end_date": "2026-01-01"
}'
```

### JavaScript

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

### Python

```python
import httpx

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

payload = {
  "name": "string",
  "description": "string",
  "notes": "string",
  "start_date": "2026-01-01",
  "end_date": "2026-01-01"
}

response = httpx.patch("https://api.ondayzero.com/api/v1/budgets/{budget_id}", headers=headers, json=payload)
data = response.json()
```

## See also

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