Skip to main content
This tool uses the Redbark REST API, which is in beta. Behaviour may change as the API evolves.
Sure sync runs as a standalone Docker container that pulls transactions from the Redbark API and imports them directly into your Sure instance. It is not a dashboard destination.
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_write scope

Setup

1

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.
2

Get a Sure API key

Log into your Sure instance, go to Settings > Security > API Keys, and create a key with read_write scope.
3

Find your Redbark account IDs

Run the tool with --list-redbark-accounts to see your connected accounts and their IDs:
docker run --rm \
  -e REDBARK_API_KEY=rbk_live_... \
  ghcr.io/redbark-co/sure-sync:latest \
  --list-redbark-accounts
4

Find your Sure account IDs

Run with --list-sure-accounts to see your Sure accounts:
docker run --rm \
  -e SURE_URL=http://localhost:3000 \
  -e SURE_API_KEY=your-sure-api-key \
  ghcr.io/redbark-co/sure-sync:latest \
  --list-sure-accounts
5

Create your account mapping

Map each Redbark account to a Sure account using the format redbark_id:sure_id, comma-separated:
ACCOUNT_MAPPING=acc_abc123:d5e6f7g8-1234-5678-abcd-ef1234567890,acc_def456:a1b2c3d4-5678-9012-cdef-345678901234
6

Configure environment variables

Create a .env file with your configuration:
REDBARK_API_KEY=rbk_live_a1b2c3d4e5f6...
SURE_URL=http://localhost:3000
SURE_API_KEY=your-sure-api-key
ACCOUNT_MAPPING=acc_abc123:d5e6f7g8-1234-5678-abcd-ef1234567890,acc_def456:a1b2c3d4-5678-9012-cdef-345678901234
TAG_NAME=Redbark
7

Dry run

Preview what would be imported without writing any changes:
docker run --rm --env-file .env \
  ghcr.io/redbark-co/sure-sync:latest --dry-run
8

Sync

Run the sync:
docker run --rm --env-file .env \
  ghcr.io/redbark-co/sure-sync:latest

Configuration

Environment variables

VariableRequiredDefaultDescription
REDBARK_API_KEYYesYour Redbark API key (rbk_live_...)
SURE_URLYesURL of your Sure instance
SURE_API_KEYYesSure API key (read_write scope)
ACCOUNT_MAPPINGYesAccount mapping (redbark_id:sure_id,...)
REDBARK_API_URLNohttps://api.redbark.coRedbark API base URL
SYNC_DAYSNo30Number of days of history to sync
CATEGORY_MAPPINGNoCategory mapping (see below)
TAG_NAMENoTag to apply to all synced transactions
LOG_LEVELNoinfodebug, info, warn, or error
DRY_RUNNofalseSet to true to preview without creating
BATCH_SIZENo25Transactions per batch (max 100)
CURRENCYNoOverride currency for all transactions (e.g. AUD)

Category mapping (optional)

Map Redbark transaction categories to Sure category UUIDs:
CATEGORY_MAPPING=groceries:uuid1,transport:uuid2,dining:uuid3
The left side of each mapping is a Redbark category (case-insensitive). The available categories are:
CategoryDescription
Bank FeesBank fees and charges
EntertainmentEntertainment and recreation
Food & DrinkGroceries, dining, cafes
Government & Non-ProfitGovernment services, taxes, donations
Home ImprovementHome maintenance and improvement
IncomeSalary, wages, and other income
Loan PaymentsLoan and debt repayments
MedicalHealthcare and medical expenses
MerchandiseGeneral retail purchases
Personal CarePersonal care and grooming
Rent & UtilitiesRent, electricity, water, internet
ServicesProfessional and other services
Transfer InIncoming transfers between accounts
Transfer OutOutgoing transfers between accounts
TransportationPublic transport, fuel, tolls
TravelFlights, accommodation, travel expenses
Not all transactions have a category. Categories are assigned by the bank via CDR enrichment and may vary by institution. Run --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

FlagDescription
--list-redbark-accountsList Redbark accounts and their IDs
--list-redbark-categoriesList Redbark transaction categories (for category mapping)
--list-sure-accountsList Sure accounts and their IDs
--list-sure-categoriesList Sure categories and their IDs
--dry-runPreview what would be created without writing
--days <n>Override number of days to sync
--helpShow help message

Running with Docker

Docker run

docker run --rm \
  --env-file .env \
  ghcr.io/redbark-co/sure-sync:latest
No volume is needed. Sure sync is stateless with no local cache.

Docker Compose

services:
  redbark-sure-sync:
    image: ghcr.io/redbark-co/sure-sync:latest
    restart: "no"
    environment:
      - REDBARK_API_KEY=rbk_live_your_key_here
      - SURE_URL=http://sure:3000
      - SURE_API_KEY=your-sure-api-key
      - ACCOUNT_MAPPING=acc_abc123:sure-acc-uuid
      - TAG_NAME=Redbark

  sure:
    image: ghcr.io/we-promise/sure:latest
    ports:
      - "3000:3000"
    environment:
      - DATABASE_URL=postgresql://...
      - REDIS_URL=redis://redis:6379
    depends_on:
      - postgres
      - redis

  postgres:
    image: postgres:16
    environment:
      - POSTGRES_DB=sure
      - POSTGRES_USER=sure
      - POSTGRES_PASSWORD=sure
    volumes:
      - postgres-data:/var/lib/postgresql/data

  redis:
    image: redis:7-alpine
    volumes:
      - redis-data:/data

volumes:
  postgres-data:
  redis-data:

Kubernetes CronJob

apiVersion: batch/v1
kind: CronJob
metadata:
  name: redbark-sure-sync
spec:
  schedule: "0 */6 * * *"
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: OnFailure
          containers:
            - name: sync
              image: ghcr.io/redbark-co/sure-sync:latest
              envFrom:
                - secretRef:
                    name: redbark-sure-sync-secrets

Scheduling

Use cron or your orchestrator’s scheduling to run syncs automatically:
# Sync every 6 hours
0 */6 * * * docker run --rm --env-file /home/user/.redbark-sure-sync.env ghcr.io/redbark-co/sure-sync:latest >> /var/log/redbark-sure-sync.log 2>&1

How deduplication works

Each synced transaction is tagged with a machine-readable marker in the Sure transaction notes:
[redbark:txn_abc123] | Category: groceries | MCC: 5411
On subsequent runs, the tool checks for duplicates using two methods:
  1. Exact match: searches existing Sure transactions for [redbark:<id>] in the notes field
  2. Fingerprint match: compares date + amount + normalised name to catch manually imported transactions
You can run the sync as often as you want. Duplicates are never created.

Exit codes

CodeMeaning
0Sync completed successfully
1Sync completed with errors (some transactions failed)
2Configuration error (missing env vars, invalid mapping)
3Connection 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.

Source code

The sync tool is open source: github.com/redbark-co/sure-sync