Add a Ledger Account to a Ledger Category

We can use the add ledger account to category endpoint to add an account to a category. For this, we simply need the ids of both the parent category and the ledger account we will be nesting under it.

curl --request PUT \
     --url \
     --header 'Accept: application/json'

After we add an account to a category, it can be removed by using the remove ledger account from category endpoint. This does not affect the underlying transactions, which are immutable, or the underlying account: it simply removes the newly excluded account balance from the category balance calculation.

Finally, to add several accounts to a category, we can use the list ledger transactions endpoint to query transactions by metadata and programmatically add them into a category using the same API call above repeatedly.