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

> Update budget line

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

## Description

Update amounts on a budget line.

## Authentication

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

## Parameters

- `budget_id` (path, string, required)
- `line_id` (path, string, required)

## Request body

Schema: `BudgetLineUpdateRequest`

- `jan_amount` (integer) — January budget amount in cents.
- `feb_amount` (integer) — February budget amount in cents.
- `mar_amount` (integer) — March budget amount in cents.
- `apr_amount` (integer) — April budget amount in cents.
- `may_amount` (integer) — May budget amount in cents.
- `jun_amount` (integer) — June budget amount in cents.
- `jul_amount` (integer) — July budget amount in cents.
- `aug_amount` (integer) — August budget amount in cents.
- `sep_amount` (integer) — September budget amount in cents.
- `oct_amount` (integer) — October budget amount in cents.
- `nov_amount` (integer) — November budget amount in cents.
- `dec_amount` (integer) — December budget amount in cents.
- `notes` (string) — Optional notes for this line.

## Responses

### 200 — Successful Response

Schema: `BudgetLineResponse`

- `id` (string · required) — Budget line UUID.
- `budget_id` (string · required) — Parent budget UUID.
- `ledger_id` (string · required) — Ledger account UUID.
- `ledger_name` (string) — Ledger account name.
- `ledger_type` (string) — Ledger account type (revenue, expense, etc.).
- `jan_amount` (integer · required) — January budget amount in cents.
- `feb_amount` (integer · required) — February budget amount in cents.
- `mar_amount` (integer · required) — March budget amount in cents.
- `apr_amount` (integer · required) — April budget amount in cents.
- `may_amount` (integer · required) — May budget amount in cents.
- `jun_amount` (integer · required) — June budget amount in cents.
- `jul_amount` (integer · required) — July budget amount in cents.
- `aug_amount` (integer · required) — August budget amount in cents.
- `sep_amount` (integer · required) — September budget amount in cents.
- `oct_amount` (integer · required) — October budget amount in cents.
- `nov_amount` (integer · required) — November budget amount in cents.
- `dec_amount` (integer · required) — December budget amount in cents.
- `annual_amount` (integer · required) — Total annual budget amount in cents.
- `quarterly_amounts` (object · required) — Amounts by quarter (q1, q2, q3, q4).
- `notes` (string) — Line 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

### 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}/lines/{line_id}' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "jan_amount": 0,
  "feb_amount": 0,
  "mar_amount": 0,
  "apr_amount": 0,
  "may_amount": 0,
  "jun_amount": 0
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/budgets/{budget_id}/lines/{line_id}', {
  method: 'PATCH',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "jan_amount": 0,
  "feb_amount": 0,
  "mar_amount": 0,
  "apr_amount": 0,
  "may_amount": 0,
  "jun_amount": 0
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {
  "jan_amount": 0,
  "feb_amount": 0,
  "mar_amount": 0,
  "apr_amount": 0,
  "may_amount": 0,
  "jun_amount": 0
}

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

## See also

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