PATCH /v1/notification-rules/{id}

Change a rule's name, threshold, category or enabled flag. The event cannot change.

Auth. Send the token in the X-Ledger-Token header.

Parameters

NameInTypeRequiredDescription
idpathintegerrequired

Request body

application/json: object

FieldTypeRequiredDescription
namestringoptional
thresholdintegeroptional
categorystring or nulloptional
enabledbooleanoptional

Responses

StatusMeaningBody
200The updated ruleNotificationRule
400Request rejectedError
404Request rejectedError
429Too many requests from this client address. Wait the number of seconds in Retry-After, then try again.Error

Example response

{
  "id": 0,
  "name": "string",
  "event": "income",
  "threshold": 0,
  "category": "string",
  "topic": "string",
  "enabled": true,
  "created_at": "2026-10-11T00:00:00Z"
}

Code samples

Set KEY to your own token first.

curl

curl \
  -X PATCH \
  -H X-Ledger-Token:$KEY \
  -H "Content-Type: application/json" \
  -d '{"name": "string", "threshold": 0, "category": "string", "enabled": true}' \
  "https://api.sasek.org/ledger/v1/notification-rules/{id}"

JavaScript

const res = await fetch("https://api.sasek.org/ledger/v1/notification-rules/{id}", {
  method: "PATCH",
  headers: { "X-Ledger-Token": KEY, "Content-Type": "application/json" },
  body: JSON.stringify({
    "name": "string",
    "threshold": 0,
    "category": "string",
    "enabled": true
  }),
});
const data = await res.json();

Python

import json
import os
import urllib.request

payload = {   'name': 'string',
    'threshold': 0,
    'category': 'string',
    'enabled': True}

request = urllib.request.Request(
    "https://api.sasek.org/ledger/v1/notification-rules/{id}",
    method="PATCH",
    headers={
        "X-Ledger-Token": os.environ["KEY"],
        "Content-Type": "application/json",
    },
    data=json.dumps(payload).encode(),
)
with urllib.request.urlopen(request) as response:
    print(json.load(response))