# budgets.save

Create or edit a monthly, quarterly or yearly spending budget, for all expenses or one category. Actuals use ledger entries and splits, with refunds deducted and transfers excluded. Requires current expectedRevision or zero for a new budget and an idempotencyKey. Does not change bookkeeping entries.

`POST /api/v1/accounting/budgets.save`

Permissions: `accounting:read`, `accounting:write` · Roles: admin, finance · Idempotency key required · Send `expectedRevision`

MCP tool: `accounting_budgets_save`

## Fields

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `id` | string (ID) |  | The record's ID. |
| `expectedRevision` | integer | Yes | The record's current revision, from the last time you read it. If someone changed the record since, the request is refused with a conflict so you can reload and check before trying again. 0 to 9007199254740991. |
| `idempotencyKey` | string | Yes | Any unique text you generate once per intended change, so a retried request only happens once. Send it as the Idempotency-Key header instead if you prefer; if you send both they must match. 8–200 characters. |
| `name` | string | Yes | A display name. 1–160 characters. |
| `categoryId` | string (ID) or null | Yes | The ID of a category, from categories.list. |
| `currency` | string | Yes | Three-letter currency code, such as CAD or USD. |
| `amountMinor` | string | Yes | An amount in cents (the currency's smallest unit), written as a whole-number string such as "1250" for $12.50. Matches ^\d{1,15}$. |
| `period` | enum | Yes | The period to cover. One of: `monthly`, `quarterly`, `yearly`. |
| `startsOn` | string (date) | Yes | A date, as YYYY-MM-DD. |
| `endsOn` | string (date) or null | Yes |  |
| `active` | boolean | Yes | Whether the record is turned on. |

## Example request

```bash
curl https://app.getoatmilk.com/api/v1/accounting/budgets.save \
  -H "Authorization: Bearer $OATMILK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
  "expectedRevision": 3,
  "name": "Synthetic Ventures Inc.",
  "categoryId": "7f0f6c1e-1c1f-4b5e-9c8d-2f5e8e3c1a10",
  "currency": "CAD",
  "amountMinor": "1250",
  "period": "monthly",
  "startsOn": "2026-09-01",
  "endsOn": "2026-09-01",
  "active": true,
  "id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d"
}'
```

Reference page: https://app.getoatmilk.com/docs/api/budgets.save
