> ## Documentation Index
> Fetch the complete documentation index at: https://redbark.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Connections, accounts and transactions

> Read banking and brokerage connections, accounts, balances, details, transactions, holdings, and trades through API v2.

All reads need `data:read` (connections and consents need `connections:read`). Banking reads may pass through the short-lived connection gateway cache; live banking and brokerage provider payloads are never written to Redbark's primary database or logs. Opt-in [Documents](https://redbark.com/docs/documents.md) stores uploaded files and extracted transactions separately. See [Caching](#caching) for freshness, purge, and opt-out behaviour.

## Connections

`GET /v2/connections` (cheap), `GET /v2/connections/{id}`. Filters: `status[]`, `provider`. Include: `accounts`.

```json theme={null}
{
  "id": "conn_2Bc4De6fGh8jKl0mNp3qRs",
  "object": "connection",
  "provider": "fiskil",
  "category": "banking",
  "institution": { "id": "inst_fk_anz", "name": "ANZ", "logo": null },
  "status": "active",
  "consent": { "id": "cons_7Hq2Kp9dLm3nRt5vWx8yZa", "status": "active", "expires_at": "2027-03-01T00:00:00.000Z" },
  "accounts": null,
  "account_count": 3,
  "last_refreshed_at": "2026-08-21T02:10:00.000Z",
  "ready_at": "2026-03-01T10:02:11.000Z",
  "metadata": null,
  "livemode": true,
  "created": "2026-03-01T10:01:58.000Z",
  "updated": "2026-08-21T02:10:00.000Z"
}
```

`status` is computed: `pending` (accounts not landed yet or MFA outstanding), `active`, `expiring` (consent ends within 30 days), `expired`, `invalidated` (bank-side), `revoked`.

## Consents

`GET /v2/consents?connection=` and `GET /v2/consents/{id}`. Consents exist for Australian bank connections and brokerage connections. New Zealand and United States bank connections have no consent object. `status` is `active`, `expiring`, `expired` or `withdrawn`; brokerage consents have no expiry (`expires_at: null`). `termination_reason` is free text, not an enum: it is either our own note for a withdrawal we initiated (`connection_deleted`) or the bank's wording for one the user made at their end. Show it, do not branch on it.

```json theme={null}
{ "id": "cons_7Hq2Kp9dLm3nRt5vWx8yZa", "object": "consent", "connection": "conn_2Bc4De6fGh8jKl0mNp3qRs", "status": "active", "purpose": "sync", "data_types": ["accounts", "transactions"], "expires_at": "2027-03-01T00:00:00.000Z", "withdrawn_at": null, "termination_reason": null, "livemode": true, "created": "2026-03-01T10:02:00.000Z", "updated": "2026-03-01T10:02:00.000Z" }
```

## Accounts

`GET /v2/accounts?connection=` (cheap), `GET /v2/accounts/{id}`. `account_number` is masked to the last four digits.

`status` is `available`, `syncing` (first transactions still arriving) or `unavailable`.

> [!NOTE]
>
> An account the provider stopped returning, for example a closed account or one removed from the consent, stays listed with `status: "unavailable"`. Its transactions, single-account balance, details, holdings and trades return `404 account_unavailable`. Skip it rather than retrying; it becomes `available` again if the provider returns it. Bulk balances return an unavailable entry instead.

```json theme={null}
{ "id": "acct_9Lk2Mn4pQr6sTu8vWx1yZb", "object": "account_item", "connection": "conn_2Bc4De6fGh8jKl0mNp3qRs", "provider": "fiskil", "category": "banking", "name": "Everyday", "type": "transaction", "institution": { "id": "inst_fk_anz", "name": "ANZ", "logo": null }, "account_number": "xxxx1234", "currency": "aud", "status": "available", "last_updated_at": "2026-08-21T02:00:00.000Z", "livemode": true, "created": "2026-03-01T10:02:11.000Z", "updated": "2026-08-21T02:00:00.000Z" }
```

* `GET /v2/accounts/{id}/balance` (mid): `{ "object": "balance", "account": "acct_…", "current": { "amount": 123456, "currency": "aud" }, "available": { "amount": 120000, "currency": "aud" }, "currency": "aud" }`; `current`/`available` are money objects or null.
* `GET /v2/balances?account=acct_…&account=acct_…` (mid): reads up to 100 banking-account balances in one non-paginated response. Duplicate ids collapse and results retain the first-request order. Every account must exist, belong to you, and be a banking account; otherwise the whole request fails.
* `GET /v2/accounts/{id}/details` (mid): product name, deposit and lending rates, fees, features and loan details as the bank reports them, in snake\_case. Australian Fiskil accounts only. Plaid and Akahu return `400 not_supported`; brokerage and Documents return `400 wrong_endpoint_for_category`.

### Balance freshness

Balance objects include `observed_at` (ISO timestamp or null) and `freshness` (null for providers without freshness metadata). For Fiskil:

* `fresh`: a live bank observation under 4 hours old, as of `observed_at`. It need not come from this request.
* `stale`: a retained live observation under 24 hours old. Its original `observed_at` does not change.
* `stored`: Fiskil's stored copy, whose age is unknown. `observed_at` is null, and Redbark never caches this copy.
* `unavailable`: no balance could be read; balance amounts are null.

Live balance reads for API keys, the CLI, syncs and third-party apps are subject to a per-connection unattended budget. When a live read cannot run or fails transiently, eligible accounts may use retained observations or the provider's stored copy. MCP never starts a live bank balance read; it uses those existing balances only. Authorisation or consent failures never use either fallback.

With Redbark caching disabled, retained live observations are neither stored nor served, but eligible reads can still use Fiskil's stored copy. Live attempts remain serialized per connection and limited to once per account every 15 minutes. `GET /v2/accounts/{account}/balance` can still return `429 balance_refresh_limited` with `Retry-After` for its one account.

`GET /v2/balances` never returns `balance_refresh_limited`. Accounts still held by the refresh limit return `freshness: "unavailable"`, null amounts and `retry_after_seconds` beside the other results. Retryable gaps can also occur when an account was not reached before the request ran out of time, or its connection is in a cooldown, deferred or temporarily unreachable. Merge successful results across calls and follow retry advice for the gaps. A retry does not guarantee a new live read.

> [!NOTE]
>
> Bulk balances retain successful providers' results when another provider is deferred, times out or is unreachable. Retryable gaps include `retry_after_seconds`; definitive provider rejections and provider-removed accounts do not. If every attempted provider fails, the request fails. Invalid, foreign and non-banking account ids still reject the whole request.

With Fiskil caching enabled, a provider-capacity wait can leave a successful balance response with some accounts unavailable while other live or retained balances are returned. Check each account's `freshness`, `observed_at` and null values before treating a total as current or complete. If the deferred connection has no balance to return, the request can fail with `provider_wait`; follow `Retry-After`. Plaid balances are not cached by Redbark and reflect Plaid's last successful connection update, not a real-time bank refresh.

## Transactions

`GET /v2/transactions?account=acct_…&from=&to=&include_pending=true` (heavy). `account` is required. Newest first, `limit` up to 100, follow `next_page_url`. Omitting `from` limits results to the last 30 days; pass it explicitly for older history, including imported Documents rows. A bare `YYYY-MM-DD` is an inclusive calendar boundary in your Redbark timezone, matching the returned `date` field. An RFC 3339 value is an instant and is converted to that timezone before the purchase-date filter is applied. When the 5,000 row ceiling is reached the response carries `X-Redbark-Truncated: true`; narrow `from`/`to`.

```json theme={null}
{
  "id": "txn_fk_4f7a…",
  "object": "transaction",
  "account": "acct_9Lk2Mn4pQr6sTu8vWx1yZb",
  "status": "posted",
  "date": "2026-08-20",
  "datetime": "2026-08-20T03:12:44+10:00",
  "post_date": "2026-08-21",
  "post_datetime": null,
  "value_date": null,
  "value_datetime": null,
  "description": "COLES 1234 RICHMOND",
  "reference": null,
  "extended_description": null,
  "amount": { "amount": -4250, "currency": "aud" },
  "direction": "debit",
  "provider_category": "FOOD_AND_DRINK_GROCERIES",
  "category": "cat_8Mn3Pq5rSt7uVw9xYz1aBc",
  "merchant_name": "Coles",
  "merchant_category_code": "5411",
  "livemode": true
}
```

`provider_category` is the bank or enrichment code (see `/v2/provider_categories`); `category` is the user category it resolves to through your source claims, or `null`.

> [!NOTE]
>
> `amount.currency` is the transaction's own currency, which can differ from the account's `currency`. A PayPal or multi-currency account can return USD rows on an AUD account, for example. When the provider gives no currency for a transaction, `amount.currency` falls back to the account currency. Documents transactions use each extracted row's currency the same way. Amounts are never converted between currencies. This applies to both list and single-transaction reads.

`reference` is the provider-supplied payment reference. `extended_description` is additional transaction text, such as an NPP payment description or payer/payee label. Both fields are always present and are `null` when unavailable; availability depends on the bank and transaction. Use them alongside the amount and date for reconciliation, not as guaranteed unique identifiers.

`GET /v2/transactions/{id}?account=` retrieves one transaction by its tagged provider id within the account's recent window (`from`/`to` optional, default last 30 days). If the id came from older history, pass dates covering it. The search reads at most 5,000 provider rows within a bounded page budget: `400 transaction_search_incomplete` means narrow the window and retry, not that the transaction is absent. `404 transaction_not_found` means the valid window was exhausted without a match; its message names that window.

## Holdings and trades

`GET /v2/holdings?account=` and `GET /v2/trades?account=&from=&to=` (heavy, Professional plan). Quantities are decimal strings; prices and values are money objects in the holding's currency.

One holding represents one instrument. If a broker reports several rows for the same instrument, such as staked and unstaked units, the top-level quantity, average price, market value, and unrealised P\&L aggregate those rows. `current_price` comes from the largest position rather than being combined. `positions` preserves the individual rows, ordered by quantity descending, and `instrument_id` identifies the shared instrument. When the broker reports one row, `positions` contains one entry. If the provider omits an average price, market value, or unrealised P\&L from any row, the corresponding aggregate is `null` rather than a partial total.

## Caching

Banking reads may be served from a bounded, encrypted, per-connection cache. A request does not guarantee a new live bank read, even after the fresh window passes. Redbark keeps no permanent provider transaction ledger; opt-in [Documents](https://redbark.com/docs/documents.md) retains uploaded files and extracted transactions separately.

| Endpoint | Redbark cache window |
| - | - |
| `GET /v2/transactions`, `GET /v2/transactions/{id}` | 60 minutes |
| `GET /v2/accounts/{id}/details` | 15 minutes |
| `GET /v2/accounts/{id}/balance`, `GET /v2/balances` | Fiskil live observations: 4 hours fresh, retained for at most 24 hours from observation. Fiskil's provider-stored copy is never cached by Redbark. Plaid: not cached. |

`GET /v2/connections`, `GET /v2/consents` and `GET /v2/accounts` are served from Redbark's own records. Holdings and trades are not cached; every request reads live from the brokerage provider. `GET /v2/provider_categories` is a fixed list.

* Cached data is purged immediately when a consent is revoked or a connection is deleted. Expired data is deleted even when the cache is idle.
* You can turn the cache off in the dashboard under **Settings → Performance cache**. With it off, no financial payload is stored in or served from Redbark's cache, including retained live balances. See [Balance freshness](#balance-freshness) for what still applies.
* Plaid balances reflect Plaid's last successful update of the connection. Plaid says that is typically about daily, and it can be older when Plaid cannot refresh the connection.
* Responses carry no cache-status header.
* During a banking-provider outage, requests may return `503` with a `Retry-After` header.

## Provider categories

`GET /v2/provider_categories` lists every primary category and subcategory (with `parent`). This is what v1 served at `/v1/categories`; your own taxonomy lives at `/v2/categories`. The vocabulary is fixed and short, so this list is not paginated: it always returns every code in one response, `next_page_url` is always `null`, and `limit` is ignored.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.