DELETE /v1/budgets/{category}

End a category's budget from a month on. The month and the months before it keep their amounts; the budget is not listed from that month.

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

Parameters

NameInTypeRequiredDescription
categorypathstringrequired
fromquerystringrequiredThe first month without the budget, YYYY-MM. Must be this month or later.

Responses

StatusMeaningBody
200The zero row that ended the budgetobject
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

{
  "category": "string",
  "amount_cents": 0,
  "effective_from": "string"
}

Code samples

Set KEY to your own token first.

curl

curl \
  -X DELETE \
  -H X-Ledger-Token:$KEY \
  "https://api.sasek.org/ledger/v1/budgets/{category}?from=string"

JavaScript

const res = await fetch("https://api.sasek.org/ledger/v1/budgets/{category}?from=string", {
  method: "DELETE",
  headers: { "X-Ledger-Token": KEY },
});
const data = await res.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://api.sasek.org/ledger/v1/budgets/{category}?from=string",
    method="DELETE",
    headers={
        "X-Ledger-Token": os.environ["KEY"],
    },
)
with urllib.request.urlopen(request) as response:
    print(json.load(response))