[PR #2683] [MERGED] (api) ability to run bank sync via the API #46274

Closed
opened 2026-04-26 08:22:01 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/2683
Author: @MatissJanis
Created: 4/29/2024
Status: Merged
Merged: 5/16/2024
Merged by: @MatissJanis

Base: masterHead: matiss/api-bank-sync


📝 Commits (4)

  • 33c9816 (api) ability to run bank sync via the API
  • 238eac9 Release notes
  • f685771 Patch bug in multi-account sync
  • 69aa671 Merge branch 'master' into matiss/api-bank-sync

📊 Changes

8 files changed (+34 additions, -6 deletions)

View changed files

📝 packages/api/methods.ts (+4 -0)
📝 packages/loot-core/src/client/actions/account.ts (+1 -1)
📝 packages/loot-core/src/server/api.ts (+12 -0)
📝 packages/loot-core/src/server/main.ts (+4 -4)
📝 packages/loot-core/src/shared/errors.ts (+4 -0)
📝 packages/loot-core/src/types/api-handlers.d.ts (+2 -0)
📝 packages/loot-core/src/types/server-handlers.d.ts (+1 -1)
upcoming-release-notes/2683.md (+6 -0)

📄 Description

Allow running 3rd party (gocardless, simplefin) bank-sync via the API package.

This will allow people to run the bank-sync operation in the background on a schedule (i.e. with cron jobs).

Usage:

const api = require('@actual-app/api');

(async () => {
  await api.init({
    // Budget data will be cached locally here, in subdirectories for each file.
    dataDir: '/path/to/budget/file',
    // This is the URL of your running server
    serverURL: 'https://xxxxxxx.fly.dev',
    // This is the password you use to log into the server
    password: 'xxxxxx',
  });

  // This is the ID from Settings → Show advanced settings → Sync ID
  await api.downloadBudget('xxxxxx-xxxx-xxxxx-xxxxx');

  // Run bank sync for a single account
  await api.runBankSync({ accountId: 'xxxxxx-xxxxx-xxx-xxxxx-xxxxxxxx' });

  // Run bank sync for all accounts
  await api.runBankSync();

  await api.shutdown();
})();

Docs: https://github.com/actualbudget/docs/pull/350


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/2683 **Author:** [@MatissJanis](https://github.com/MatissJanis) **Created:** 4/29/2024 **Status:** ✅ Merged **Merged:** 5/16/2024 **Merged by:** [@MatissJanis](https://github.com/MatissJanis) **Base:** `master` ← **Head:** `matiss/api-bank-sync` --- ### 📝 Commits (4) - [`33c9816`](https://github.com/actualbudget/actual/commit/33c98167775fc01b14e34ceb16a09045362cafb1) :sparkles: (api) ability to run bank sync via the API - [`238eac9`](https://github.com/actualbudget/actual/commit/238eac93471af2a05e72bfbdcd52d8354c2e85b9) Release notes - [`f685771`](https://github.com/actualbudget/actual/commit/f6857710d0ebf62ef0aca6b4d738d96f32646d78) Patch bug in multi-account sync - [`69aa671`](https://github.com/actualbudget/actual/commit/69aa671b80729b9974252a1f140297d2ae9e90dd) Merge branch 'master' into matiss/api-bank-sync ### 📊 Changes **8 files changed** (+34 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `packages/api/methods.ts` (+4 -0) 📝 `packages/loot-core/src/client/actions/account.ts` (+1 -1) 📝 `packages/loot-core/src/server/api.ts` (+12 -0) 📝 `packages/loot-core/src/server/main.ts` (+4 -4) 📝 `packages/loot-core/src/shared/errors.ts` (+4 -0) 📝 `packages/loot-core/src/types/api-handlers.d.ts` (+2 -0) 📝 `packages/loot-core/src/types/server-handlers.d.ts` (+1 -1) ➕ `upcoming-release-notes/2683.md` (+6 -0) </details> ### 📄 Description Allow running 3rd party (gocardless, simplefin) bank-sync via the API package. This will allow people to run the bank-sync operation in the background on a schedule (i.e. with cron jobs). Usage: ```javascript const api = require('@actual-app/api'); (async () => { await api.init({ // Budget data will be cached locally here, in subdirectories for each file. dataDir: '/path/to/budget/file', // This is the URL of your running server serverURL: 'https://xxxxxxx.fly.dev', // This is the password you use to log into the server password: 'xxxxxx', }); // This is the ID from Settings → Show advanced settings → Sync ID await api.downloadBudget('xxxxxx-xxxx-xxxxx-xxxxx'); // Run bank sync for a single account await api.runBankSync({ accountId: 'xxxxxx-xxxxx-xxx-xxxxx-xxxxxxxx' }); // Run bank sync for all accounts await api.runBankSync(); await api.shutdown(); })(); ``` Docs: https://github.com/actualbudget/docs/pull/350 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-26 08:22:01 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#46274