---
title: "Patch Db Rule"
method: PATCH
path: "/api/payday/db-rules/{rule_id}"
tags: ["Payday"]
---

# Patch Db Rule

`PATCH /api/payday/db-rules/{rule_id}`

## Request

- Base URL: `https://api.earmarkiq.app` (the document declares no server; this is the origin it was published from)
- URL: `https://api.earmarkiq.app/api/payday/db-rules/{rule_id}`
- Auth: HTTP bearer

Update a single payday rule in place.

The common edits — flipping a rule on or off, nudging an amount — used to
go through the full PUT, which deletes and reinserts every rule the user
has. This touches one row.

## Path parameters

- `rule_id` string, required

## Request body

- PaydayRulePatch: Partial update for a single rule. Every field is optional; only those explicitly present in the request body are applied.
  - `amount` number, nullable
  - `active` boolean, nullable
  - `timing` string, nullable
  - `timing_label` string, nullable
  - `description` string, nullable
  - `target_id` string, nullable
  - `target_label` string, nullable

## Response `200`

Successful Response

- DBRulesResponse
  - `rules` PaydayRule[], required
    - `id` string, required
    - `type` string, required
    - `amount` number, required
    - `timing` string, required
    - `timing_label` string, required
    - `active` boolean, required
    - `description` string, nullable
    - `target_id` string, nullable
    - `target_label` string, nullable
    - `virtual_budget_category` string, nullable
    - `pot_category` string, nullable
    - `goal_id` string, nullable
    - `goal_name` string, nullable
  - `total_allocated` number
  - `remaining_after_rules` number
  - `timeline` TimelineEvent[]
    - `order` integer, required
    - `day` integer, required
    - `label` string, required
    - `amount` number, required
    - `type` string, required
    - `icon` string, required
    - `color_key` string, required
  - `budget_proposals` BudgetProposal[]
    - `category` string, required
    - `proposed_limit` number, required
    - `current_limit` number, nullable
    - `source` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/earmarkiq/apis/earmark-api.md) · [All operations](https://skmtc.dev/earmarkiq/apis/earmark-api/llms.txt) · [OpenAPI document](https://skmtc.dev/earmarkiq/apis/earmark-api/revisions/4a2c41907105?raw)
