goldberry

All docs ↓

JSON API

Goldberry has a JSON API at /api/v1 for scripts, Home Assistant and AI tools. It calls the same service layer as the web app, so every rule (holds, locks, no negative balances) applies. See ADR 0015.

Read

Endpoint Returns
GET /me The token and the parent it acts as
GET /household Name, currency, time zone
GET /kids Kids with totals (?include_disabled=true)
GET /kids/{kid} A kid with jars, balances, holds, locks, split
GET /kids/{kid}/jars Just the jars
GET /kids/{kid}/ledger Entries, newest first (limit, jar_id, from, to)
GET /kids/{kid}/goals Active goals with progress
GET /kids/{kid}/requests, GET /requests Withdrawal requests (status, limit)
export GB=https://goldberry.example.com TOKEN=gb_…
curl -s -H "Authorization: Bearer $TOKEN" $GB/api/v1/kids/ava | jq '.jars[] | {name, available}'

Write

Writes are PUT or POST with a JSON body. Unknown fields are rejected, so a typo can't silently do nothing.

Endpoint Scope Does
POST /kids/{kid}/jars, PUT /jars/{id}, POST /jars/{id}/archive write Add, rename, archive a jar
PUT /kids/{kid}/split write Set the split: {"shares": {"<jar id>": 7000, …}}, totalling 10000
POST /kids/{kid}/goals, PUT /goals/{id}, POST /goals/{id}/archive write Add, replace (send every field), archive a goal
POST /kids/{kid}/entries money Add or remove funds
POST /entries:batch money Many entries, all or nothing
POST /entries/{id}/reverse money Undo an entry (a split deposit reverses together)
POST /kids/{kid}/transfers money Move money between a kid's jars
POST /requests/{id}/decision money Approve (optionally less) or deny a request

Parents can already do all of this in the app, so a token can do no more than its owner. Jar locks that bind kids don't bind a parent's token.

Posting money safely

# Pay two kids at once, safely retryable
curl -s -X POST $GB/api/v1/entries:batch -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' -d '{
  "entries": [
    {"kid": "ava", "amount": 1000, "comment": "October chores", "idempotency_key": "chores-2026-10-ava"},
    {"kid": "leo", "amount": 800,  "comment": "October chores", "idempotency_key": "chores-2026-10-leo"}
  ]}' | jq

# Load an opening balance dated in the past
curl -s -X POST $GB/api/v1/kids/ava/entries -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' -d '{
  "amount": 12500, "comment": "Opening balance", "effective_at": "2026-01-01", "idempotency_key": "opening-ava"}' | jq

View this page on GitHub