2026-05-03-integrations-bulk-api

Sun May 03 2026 07:00:00 GMT+0700 (Western Indonesia Time)type/changelog

2026-05-03 — Integrations bulk API + AI agent docs

Commits ffa39d9, dc48ece, 815bdc7.

What

  • Shipped bearer-authenticated POST /api/integrations/v1/transactions/bulk for external AI agents to push parsed transactions.
  • Added preview toggle so the agent can dry-run categorization before committing.
  • Wrote docs/integrations/ai-agent-push-transactions.md: the operating spec for the daily 21:00 BCA email agent — fixed BANK_ACCOUNT_ID env, category review/approval flow, bulk API reference.
  • Defaulted OpenRouter routing to a free model with a documented fallback chain via OPENROUTER_MODEL.
  • Fixed lean() typing on bulk category lookups during build.

Why

Manual transaction entry was the friction point. BCA already sends transaction notification emails; an external agent (running on a schedule) can parse them, propose categories, and push in bulk — turning data entry into approval. Preview toggle keeps a human-in-the-loop default before commit.

Touches

  • src/app/api/integrations/v1/transactions/bulk/*
  • src/lib/imports/importNormalizeCategories.ts
  • docs/integrations/ai-agent-push-transactions.md

Risks introduced

  • Bearer token must be rotated manually; see [[Projects/personal-finance-notion/runbooks/runbook-agent-push-401|runbook-agent-push-401]] if the agent stops working.
  • OpenRouter free-tier model availability is outside our control — fallback chain mitigates but doesn't eliminate.