w0rth

w0rth Agent API (v1)

A small JSON API so AI agents (and scripts) can read and record a user's finances without driving the web UI.

w0rth is a ledger, not a bank: it never connects to bank accounts and has no payment features. Through the API an agent reads balances, records income and expenses, and reconciles an account to its real balance, so the user's finances stay organized.

  • Quick setup for agents: tell your agent Fetch and execute the instructions to set me up for w0rth from https://w0rth.com/agent-setup/prompt.md
  • Base URL: https://w0rth.com/api/v1
  • Format: JSON in, JSON out (content-type: application/json)
  • Dates: YYYY-MM-DD; "today" means today in America/Mexico_City
  • Amounts: JSON numbers rounded to cents. There is no currency code on accounts or transactions — the ledger is single-currency. The dashboard displays amounts as MXN by default, but that unit is not stored. When you record a movement, use the same unit as the balances you just read from GET /context. If the currency is unclear, ask the user before writing.
  • Sign convention: in responses, expenses and credit-card balances you owe are negative (same as the dashboard). In POST /transactions, send a positive amount and set type to "income" or "expense"; the API applies the sign.
  • created_at is a Unix timestamp in seconds.

Authentication

  1. Sign in at w0rth.com, open the user menu (your initials, top right) → API tokens.
  2. Create a token and give it a name (for example "My assistant"). The token (w0rth_…) is shown once; copy it.
  3. Send it on every request:
Authorization: Bearer w0rth_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Tokens are scoped to your user, can be revoked at any time from the same page, and only their SHA-256 hash is stored. The API does not accept the browser session cookie, so it cannot be called cross-site from a logged-in browser (no CSRF surface).

Rate limit: 120 requests per minute per token. Over the limit you get 429 with Retry-After: 60.

Plans

Pricing is a flat subscription — never per API call. See w0rth.com/pricing.

FreePro ($5/mo or $49/yr · $99 MXN/mes or $899 MXN/año)
Reads (GET)UnlimitedUnlimited
New entries (transactions, transfers, reconcile adjustments)100 per calendar month (UTC)Unlimited
Open accounts3Unlimited
Active agent tokens15
Goals / active debts2 / 1Unlimited
ReportsLast 3 monthsFull history

Limits only block creating new items; nothing that already exists is hidden or removed. GET /api/v1/context returns the current plan (tier, limits, usage.monthly_transactions, upgrade_url) so an agent can tell the user before it hits a limit. When a write is refused you get:

{ "error": { "code": "limit_reached", "message": "The Free plan allows 100 new entries per month (you have 100). Upgrade to Pro at https://w0rth.com/pricing" } }

Nothing was written when you get this error: tell the user and link them to the pricing page; don't retry.

Errors

Every error has the same shape:

{ "error": { "code": "validation_error", "message": "amount must be at least 0.01.", "field": "amount" } }
StatuscodeWhen
400invalid_jsonBody is not a JSON object
401unauthorizedMissing, invalid, or revoked token
403limit_reachedPlan limit reached (Free: 100 new entries per calendar month). The message includes the upgrade URL https://w0rth.com/pricing. Reads are never limited.
404not_foundAccount, category, commitment, or endpoint not found (never leaks other users' data)
405method_not_allowedWrong HTTP method
409ambiguousA name matches more than one account/category; use the id
422validation_errorA field is missing or invalid (field says which)
429rate_limitedToo many requests

Endpoints

GET /api/v1/context

Everything an agent needs in one call: open accounts with balances, totals, categories, and upcoming commitments.

Query: days (1–366, default 30) — how far ahead to list upcoming items. Overdue items are included with overdue: true.

curl https://w0rth.com/api/v1/context -H "Authorization: Bearer $W0RTH_TOKEN"
{
  "today": "2026-11-16",
  "timezone": "America/Mexico_City",
  "user": { "name": "Agent Test", "tier": "pro" },
  "plan": { "tier": "pro", "unlimited": true,
    "limits": { "accounts": null, "api_tokens": 5, "monthly_transactions": null, "goals": null, "debts": null },
    "usage": { "monthly_transactions": 24 }, "upgrade_url": null },
  "totals": { "wealth": 25449.04, "debts": 10875.93, "net": 14573.11 },
  "accounts": [
    { "id": 3, "name": "Nu Crédito", "type": "CREDIT", "balance": -1934.94, "closed": false,
      "credit_limit": 20000, "available_credit": 18065.06, "statement_day": 6, "payment_due_day": 26 },
    { "id": 2, "name": "Nu", "type": "DEBIT", "balance": 27383.98, "closed": false }
  ],
  "categories": [{ "id": 2, "name": "Entretenimiento", "type": "EXPENSE" }],
  "upcoming": { "days": 30, "items": [
    { "kind": "subscription", "id": 1, "name": "Netflix", "amount": 299, "due_date": "2026-11-20",
      "account_id": 2, "account_name": "Nu", "overdue": false }
  ] }
}

totals.wealth is the sum of open account balances (credit cards count negative), totals.debts is the remaining amount of unsettled debts, and net = wealth - debts. upcoming.items[].kind is one of subscription, credit_card_payment, debt_payment, goal_contribution.

Context does not include a full list of goals — only any upcoming goal_contribution items. There is no GET /goals yet; use the dashboard for that. Debts are listed in full at GET /api/v1/debts (see below); totals.debts is the remaining amount of unsettled debts.

GET /api/v1/accounts

Query: include_closed=1 to include closed accounts.

curl https://w0rth.com/api/v1/accounts -H "Authorization: Bearer $W0RTH_TOKEN"
{ "accounts": [ { "id": 1, "name": "Santander", "type": "DEBIT", "balance": 12277, "closed": false } ] }

GET /api/v1/transactions

Newest first. Only top-level rows; split parts come nested in split_parts.

Query: account_id, category_id, from (date, inclusive), to (date, inclusive), limit (1–500, default 50), offset. Page with limit/offset when you need more than one page (pagination.has_more / pagination.next_offset). limit=500 is supported; prefer 50–100 unless you need a large page.

curl "https://w0rth.com/api/v1/transactions?account_id=2&from=2026-11-01&limit=20" \
  -H "Authorization: Bearer $W0RTH_TOKEN"
{
  "transactions": [
    { "id": 2, "date": "2026-11-16", "description": "GTA 6", "amount": -1465, "type": "expense",
      "account_id": 2, "account_name": "Nu", "category_id": 2, "category_name": "Entretenimiento",
      "is_transfer": false, "linked_transaction_id": null, "affects_balance": true,
      "idempotency_key": null, "created_at": 1794894937 }
  ],
  "pagination": { "limit": 20, "offset": 0, "has_more": false, "next_offset": null }
}

type is income, expense, or transfer. affects_balance: false marks historical entries that were logged without changing the balance.

POST /api/v1/transactions

Record one income or expense and update the account balance (same as the dashboard's form for a single payment).

FieldRequiredNotes
typeyes"income" or "expense"
amountyesPositive number; the sign comes from type
account_id or accountyesId, or the account name (case-insensitive, open accounts only)
datenoDefault today
descriptionnoDefault: category name, else "Income"/"Expense"
category_id or categorynoId, or category name (case-insensitive). Unknown names return 404 with the valid options
affects_balancenoDefault true. false logs a historical entry without changing the balance
idempotency_keynoUp to 200 chars, unique per user. Retrying with the same key returns the original transaction (200, idempotent_replay: true) and does not create a second one
curl https://w0rth.com/api/v1/transactions \
  -H "Authorization: Bearer $W0RTH_TOKEN" -H "content-type: application/json" \
  -d '{"type":"income","account":"Santander","amount":12277,"date":"2026-11-15",
       "category":"Salario","description":"Paycheck","idempotency_key":"santander-2026-11-15-12277"}'

201 Created:

{
  "idempotent_replay": false,
  "transaction": { "id": 1, "date": "2026-11-15", "description": "Paycheck", "amount": 12277, "type": "income",
                   "account_id": 1, "account_name": "Santander", "category_id": 1, "category_name": "Salario",
                   "affects_balance": true, "idempotency_key": "santander-2026-11-15-12277" },
  "account": { "id": 1, "name": "Santander", "type": "DEBIT", "balance": 12277, "closed": false },
  "previous_balance": 0
}

Transfers and installment (MSI) purchases are not available through the API yet; use the dashboard.

DELETE /api/v1/transactions/:id

Delete one transaction. By default this also reverses its amount on the paying account (same as deleting it in the dashboard).

FieldRequiredNotes
keep_balancenoQuery (?keep_balance=true) or JSON body. Default false. When true, the row is removed from history and reports but the account's current balance does not change. Use this when that amount was already counted in a balance adjustment / reconcile.
# Already counted in an adjustment — remove the record, leave the balance:
curl -X DELETE "https://w0rth.com/api/v1/transactions/123?keep_balance=true" \
  -H "Authorization: Bearer $W0RTH_TOKEN"
{ "deleted": true, "id": 123, "keep_balance": true,
  "account": { "id": 2, "name": "Banorte", "type": "DEBIT", "balance": 4040.18, "closed": false } }

Split parts and historical entries never moved the balance, so keep_balance is always treated as true for those.

POST /api/v1/accounts/:id/reconcile

Set an account to its real balance. This is exactly what the dashboard does when you edit an account's balance with "record difference" on: the balance is set to target_balance and a transaction named "Balance adjustment (increase)" or "Balance adjustment (decrease)" is recorded for the difference, so reports stay consistent.

FieldRequiredNotes
target_balanceyesThe real balance (negative for a credit card you owe on)
datenoDate of the adjustment row, default today
notenoReplaces the default description
idempotency_keynoSame semantics as above
curl https://w0rth.com/api/v1/accounts/2/reconcile \
  -H "Authorization: Bearer $W0RTH_TOKEN" -H "content-type: application/json" \
  -d '{"target_balance":22119.76}'

201 Created:

{
  "idempotent_replay": false,
  "changed": true,
  "adjustment": { "id": 3, "date": "2026-11-16", "description": "Balance adjustment (decrease)", "amount": -3799.22,
                  "type": "expense", "account_id": 2, "affects_balance": true },
  "previous_balance": 25918.98,
  "difference": -3799.22,
  "account": { "id": 2, "name": "Nu", "type": "DEBIT", "balance": 22119.76, "closed": false }
}

If the account already matches, nothing is written and you get 200 with "changed": false and "adjustment": null.

GET /api/v1/commitments

List recurring commitments (subscriptions) with their next due date, the account that pays them, and the expense category used when a payment is recorded.

curl https://w0rth.com/api/v1/commitments -H "Authorization: Bearer $W0RTH_TOKEN"
{
  "commitments": [
    { "kind": "subscription", "id": 9, "name": "Patreon de Silvaya", "amount": 69.6,
      "due_date": "2026-12-16", "billing_day": 16, "last_paid_date": "2026-11-17",
      "account_id": 3, "account_name": "Nu", "category_id": 2, "category_name": "Servicios" }
  ]
}

Installment payments, goal contributions, and credit-card payments still appear under GET /context → upcoming; marking those paid from the API is not available yet (use the dashboard). Debts can be marked paid with POST /api/v1/debts/:id/pay (see below).

PATCH /api/v1/commitments/:id

Set or clear the expense category used when this commitment is marked paid. The category must be one of the user's expense categories. This does not change past payments.

FieldRequiredNotes
category_id or categoryyesId, or category name (case-insensitive). Send category_id: null (or an empty category) to clear it.
curl -X PATCH https://w0rth.com/api/v1/commitments/9 \
  -H "Authorization: Bearer $W0RTH_TOKEN" -H "content-type: application/json" \
  -d '{"category":"Servicios"}'
{ "commitment": { "kind": "subscription", "id": 9, "name": "Patreon de Silvaya", "amount": 69.6,
                  "due_date": "2026-12-16", "billing_day": 16, "last_paid_date": "2026-11-17",
                  "account_id": 3, "account_name": "Nu", "category_id": 2, "category_name": "Servicios" } }

GET /api/v1/commitments/:id returns the same commitment object for one id.

POST /api/v1/commitments/:id/pay

Mark a commitment as paid for the current cycle and move the next due date forward. If the commitment has a category, the payment transaction uses it; otherwise the expense is uncategorized (same as before).

FieldRequiredNotes
affects_balancenoDefault true. When true, records an expense and lowers the paying account (same as "Mark as paid" in the dashboard). When false, the cycle is marked paid and the next date moves forward, but no transaction is created and the account balance does not change. Use this when the user already updated the balance (for example after a reconcile) and that balance already includes this payment.
record_transactionnoAlias of affects_balance. If both are sent they must agree.
datenoDate to record as paid, default today
# The payment is already in the account balance — just mark the cycle paid:
curl https://w0rth.com/api/v1/commitments/9/pay   -H "Authorization: Bearer $W0RTH_TOKEN" -H "content-type: application/json"   -d '{"affects_balance":false}'

200 when affects_balance is false (transaction is null, account balance unchanged). 201 when a payment transaction is created.

{
  "commitment": { "kind": "subscription", "id": 9, "name": "Patreon de Silvaya", "amount": 69.6,
                  "due_date": "2026-12-16", "billing_day": 16, "last_paid_date": "2026-11-17",
                  "account_id": 3, "account_name": "Nu", "category_id": 2, "category_name": "Servicios" },
  "transaction": null,
  "affects_balance": false,
  "account": { "id": 3, "name": "Nu", "type": "DEBIT", "balance": 22119.76, "closed": false }
}

If the user first gives you a real balance and then says a commitment was already paid, reconcile the balance first, then mark the commitment paid with affects_balance: false. Do not record the expense and also reconcile — that would count the payment twice.

GET /api/v1/debts

List every debt with original, paid and remaining amounts, status, and its recorded payments. Open debts come first, then settled ones.

curl https://w0rth.com/api/v1/debts -H "Authorization: Bearer $W0RTH_TOKEN"
{
  "debts": [
    { "kind": "debt", "id": 4, "name": "Viaje a Las Vegas", "notes": null,
      "original_amount": 6000, "paid_amount": 6000, "remaining_amount": 0,
      "percent_paid": 100, "status": "settled",
      "monthly_amount": null, "payment_day": null, "next_payment_date": null,
      "settled_at": 1796050000, "created_at": 1793897700,
      "payments": [
        { "id": 12, "amount": 3000, "date": "2026-11-05", "transaction_id": 661 },
        { "id": 13, "amount": 3000, "date": "2026-11-30", "transaction_id": 805 }
      ] }
  ],
  "totals": { "outstanding": 0, "original": 6000, "paid": 6000 }
}

totals.outstanding is the remaining amount of open debts — the same number as totals.debts in GET /context.

POST /api/v1/debts/:id/pay

Record a payment against a debt and lower its remaining amount. When the remaining amount reaches zero the debt is marked settled.

FieldRequiredNotes
amountyesPositive payment amount. Must be no more than the remaining amount, and must equal the sum of transaction_ids when those are sent.
account_id or accountwhen affects_balance is trueThe account the money leaves. Id, or account name (case-insensitive).
affects_balancenoDefault true. When true, records an expense (Debt: <name>) and lowers the account (same as "Pay down" in the dashboard). When false, the payment is recorded against the debt, but no transaction is created and the account balance does not change. Use this when the payment is already recorded.
record_transactionnoAlias of affects_balance. If both are sent they must agree.
transaction_idsnoOnly with affects_balance: false. Existing expense transaction ids to link to this payment. Each must belong to the user, be an expense, and not already be linked to a debt payment. Their amounts must add up to amount.
datenoDate to record the payment on, default today. With transaction_ids, each payment row keeps its own transaction's date.
idempotency_keynoStrongly recommended. A retry with the same key returns the current state (idempotent_replay: true) instead of paying twice.
# The payment already left the account as two recorded expenses — link them:
curl https://w0rth.com/api/v1/debts/4/pay \
  -H "Authorization: Bearer $W0RTH_TOKEN" -H "content-type: application/json" \
  -d '{"amount":6000,"affects_balance":false,"transaction_ids":[661,805],"idempotency_key":"debt-4-pay-6000"}'

200 when affects_balance is false (transaction is null, account balance unchanged). 201 when a payment transaction is created.

{
  "idempotent_replay": false,
  "debt": { "kind": "debt", "id": 4, "name": "Viaje a Las Vegas", "notes": null,
            "original_amount": 6000, "paid_amount": 6000, "remaining_amount": 0,
            "percent_paid": 100, "status": "settled",
            "monthly_amount": null, "payment_day": null, "next_payment_date": null,
            "settled_at": 1796050000, "created_at": 1793897700,
            "payments": [
              { "id": 12, "amount": 3000, "date": "2026-11-05", "transaction_id": 661 },
              { "id": 13, "amount": 3000, "date": "2026-11-30", "transaction_id": 805 }
            ] },
  "transaction": null,
  "affects_balance": false,
  "account": null
}

Errors: 404 when the debt (or a linked transaction) is not found; 409 when the debt is already settled or a linked transaction is already linked to a debt payment; 422 when the amount is more than the remaining amount, when a linked transaction is not an expense, or when amount does not equal the sum of the linked transactions.

Do not record the expense and also mark the debt paid with affects_balance: false for the same money — that would count the payment twice against the remaining amount. Pick one: either pay with affects_balance: true (the expense is created and linked automatically), or log the expense first with POST /transactions and then link it with affects_balance: false + transaction_ids.

Recommended agent workflow

  1. GET /context once at the start of a session.
  2. Record new movements with POST /transactions, always with an idempotency_key derived from the source (for example a bank reference or account-date-amount).
  3. When the user tells you a real balance, record known movements first, then POST /accounts/:id/reconcile to absorb the rest.
  4. If they also want a recurring commitment marked as paid and that payment is already in the balance you just set, use POST /commitments/:id/pay with affects_balance: false. Use the default (true) only when the money has not yet been subtracted from the account. The same rule applies to debts: use POST /debts/:id/pay with affects_balance: false (and transaction_ids when the payment is already logged) only when the money already left the account.
  5. To remove a transaction that was already counted in an adjustment, use DELETE /transactions/:id?keep_balance=true. The default delete changes the account balance.
  6. Confirm to the user from the response (account.balance) without a second read.