This tool uses the Redbark REST API, which is in beta. Behaviour may change as the API evolves.
This is a self-hosted Docker tool. You run it on your own infrastructure alongside your Sure instance.
Prerequisites
- A running Sure instance
- Docker installed on your machine or server
- A Redbark account with connected bank accounts
- A Redbark API key
- A Sure API key with
read_writescope
Setup
Get a Redbark API key
Log into Redbark, go to Settings > API Keys, and create a new key. Copy it. It is only shown once.
Get a Sure API key
Log into your Sure instance, go to Settings > Security > API Keys, and create a key with
read_write scope.Find your Redbark account IDs
Run the tool with
--list-redbark-accounts to see your connected accounts and their IDs:Create your account mapping
Map each Redbark account to a Sure account using the format
redbark_id:sure_id, comma-separated:Configuration
Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
REDBARK_API_KEY | Yes | Your Redbark API key (rbk_live_...) | |
SURE_URL | Yes | URL of your Sure instance | |
SURE_API_KEY | Yes | Sure API key (read_write scope) | |
ACCOUNT_MAPPING | Yes | Account mapping (redbark_id:sure_id,...) | |
REDBARK_API_URL | No | https://api.redbark.co | Redbark API base URL |
SYNC_DAYS | No | 30 | Number of days of history to sync |
CATEGORY_MAPPING | No | Category mapping (see below) | |
TAG_NAME | No | Tag to apply to all synced transactions | |
LOG_LEVEL | No | info | debug, info, warn, or error |
DRY_RUN | No | false | Set to true to preview without creating |
BATCH_SIZE | No | 25 | Transactions per batch (max 100) |
CURRENCY | No | Override currency for all transactions (e.g. AUD) |
Category mapping (optional)
Map Redbark transaction categories to Sure category UUIDs:| Category | Description |
|---|---|
Bank Fees | Bank fees and charges |
Entertainment | Entertainment and recreation |
Food & Drink | Groceries, dining, cafes |
Government & Non-Profit | Government services, taxes, donations |
Home Improvement | Home maintenance and improvement |
Income | Salary, wages, and other income |
Loan Payments | Loan and debt repayments |
Medical | Healthcare and medical expenses |
Merchandise | General retail purchases |
Personal Care | Personal care and grooming |
Rent & Utilities | Rent, electricity, water, internet |
Services | Professional and other services |
Transfer In | Incoming transfers between accounts |
Transfer Out | Outgoing transfers between accounts |
Transportation | Public transport, fuel, tolls |
Travel | Flights, accommodation, travel expenses |
--list-sure-categories to find your Sure category UUIDs. Categories that don’t match a mapping are included in the transaction notes for reference.
CLI flags
| Flag | Description |
|---|---|
--list-redbark-accounts | List Redbark accounts and their IDs |
--list-redbark-categories | List Redbark transaction categories (for category mapping) |
--list-sure-accounts | List Sure accounts and their IDs |
--list-sure-categories | List Sure categories and their IDs |
--dry-run | Preview what would be created without writing |
--days <n> | Override number of days to sync |
--help | Show help message |
Running with Docker
Docker run
Docker Compose
Kubernetes CronJob
Scheduling
Use cron or your orchestrator’s scheduling to run syncs automatically:How deduplication works
Each synced transaction is tagged with a machine-readable marker in the Sure transaction notes:- Exact match: searches existing Sure transactions for
[redbark:<id>]in the notes field - Fingerprint match: compares date + amount + normalised name to catch manually imported transactions
Exit codes
| Code | Meaning |
|---|---|
| 0 | Sync completed successfully |
| 1 | Sync completed with errors (some transactions failed) |
| 2 | Configuration error (missing env vars, invalid mapping) |
| 3 | Connection error (cannot reach Redbark or Sure) |
Troubleshooting
Connection refused to Sure Make sure your Sure instance is running and reachable from the Docker container. If both services are in the same Docker Compose stack, use the service name (e.g.http://sure:3000) rather than localhost.
Invalid API key
Double-check your SURE_API_KEY has read_write scope. Read-only keys cannot create transactions.
Account not found
Verify your account mapping using --list-redbark-accounts and --list-sure-accounts. Redbark account IDs look like acc_abc123 and Sure account IDs are UUIDs.
Category mapping issues
Use --list-sure-categories to find the correct category UUIDs. Unmapped categories are included in the transaction notes rather than being lost.
Security
Your Redbark API key is only sent over HTTPS. Your Sure API key is sent to your own infrastructure. Never bake secrets into Docker images. Use
--env-file, Docker Secrets, or Kubernetes Secrets. The tool is stateless and stores no transaction data locally.