{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/synci-io/json-schema/synci-io-financial-account-resource-schema.json",
  "title": "FinancialAccountResource",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/synci-io-openapi.yml#/components/schemas/FinancialAccountResource",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "financial_connection_id": {
      "type": "string"
    },
    "financial_connection": {
      "$ref": "#/$defs/FinancialConnectionResource"
    },
    "config": {
      "description": "The financial account configuration. If the financial account has no configuration, the banks default configuration will be used.",
      "$ref": "#/$defs/InstitutionConfigResource"
    },
    "health": {
      "$ref": "#/$defs/HealthResource"
    },
    "enabled": {
      "type": "string"
    },
    "live": {
      "type": "string",
      "description": "Whether the account is in use: it AND its connection are enabled. A disabled connection keeps each\naccount's own `enabled` as the user set it, but none of its accounts sync until it is enabled again."
    },
    "integrator": {
      "type": "string",
      "description": "Provider that populates this account (GOCARDLESS / AKAHU / SNAPTRADE / ARRAY), or MANUAL for an account the user keeps by hand."
    },
    "account_category": {
      "type": [
        "string",
        "null"
      ],
      "description": "High-level kind of account: BANK (checking/savings, provided by\nbanking providers), INVESTMENT (brokerage), DEPOSIT (cash\nsub-account at a broker), LOC (line of credit), LOAN (a manual\nloan Synci models from its terms). Determines which fields are\npopulated on the account."
    },
    "loan": {
      "type": [
        "array",
        "null"
      ],
      "description": "The loan terms, rate history and derived figures. Present on LOAN accounts only.",
      "items": {}
    },
    "investment": {
      "type": [
        "array",
        "null"
      ],
      "description": "How a manual INVESTMENT account is set up and how fresh its prices are. Present on manual investment accounts only.",
      "items": {}
    },
    "raw_type": {
      "type": "string",
      "description": "Provider's free-form sub-type label (SnapTrade only). Examples:\n\"Roth IRA\", \"TFSA\", \"Cash\". Null for bank accounts."
    },
    "cash_balance": {
      "type": [
        "object",
        "null"
      ],
      "description": "Uninvested cash held at the broker, for INVESTMENT accounts.\nNull for bank accounts.",
      "properties": {
        "amount": {
          "type": "string"
        },
        "currency": {
          "type": "string"
        }
      },
      "required": [
        "amount",
        "currency"
      ]
    },
    "total_balance": {
      "type": [
        "object",
        "null"
      ],
      "description": "Broker-reported total account value (positions + cash) for\nINVESTMENT accounts. Brokerages report this on the account\npayload rather than as a dated snapshot, so it does not appear\nin the balances endpoint. Null for bank accounts.",
      "properties": {
        "amount": {
          "type": "string"
        },
        "currency": {
          "type": "string"
        }
      },
      "required": [
        "amount",
        "currency"
      ]
    },
    "meta": {
      "type": "string",
      "description": "Provider-specific extras that don't fit anywhere else (e.g.\nSnapTrade's `meta.type`/`meta.status` for crypto exchanges).\nTreat as opaque — schema is provider-defined."
    },
    "account_number_masked": {
      "type": "string",
      "description": "Masked account number (e.g. \"****1234\"). Only present when the\nprovider supplies it (SnapTrade brokerages, and banks that report\na masked card PAN via GoCardless); null otherwise."
    },
    "mask": {
      "type": "string",
      "description": "Last four digits of the card or account number (e.g. \"1234\"), for telling a user's accounts apart. Taken\nfrom the masked card number, else the account number or IBAN. Sent to every app, without `sensitive:read`.\nNull when the institution reports no number, as for some savings pots and brokerage accounts."
    },
    "name": {
      "type": "string",
      "description": "Name of the account, as assigned by the financial institution."
    },
    "custom_name": {
      "type": "string",
      "description": "Custom name for the account, as defined by the end user."
    },
    "institution_name": {
      "type": "string",
      "description": "The lender's name on a manual account, as the user entered it. Null on provider accounts and on manual\naccounts without one: group those under their connection's institution (\"Manual accounts\")."
    },
    "display_name": {
      "type": "string",
      "description": "Name of the account as defined by the end user within online channels."
    },
    "bban": {
      "type": "string",
      "description": "Basic Bank Account Number (BBAN)."
    },
    "scan": {
      "type": "string",
      "description": "UK SortCodeAccountNumber (6 digit sort code + 8 digit account number), reported by some UK banks."
    },
    "iban": {
      "type": "string",
      "description": "International Bank Account Number (IBAN)."
    },
    "bic": {
      "type": "string",
      "description": "Bank Identifier Code (BIC/SWIFT) associated with the account."
    },
    "owner_name": {
      "type": "string",
      "description": "Name of the legal account owner. If there is more than one owner, then e.g. two names might be noted here. For a corporate account, the corporate name is used for this attribute."
    },
    "owner_address": {
      "type": "string",
      "description": "Address of the legal account owner, when reported by the institution."
    },
    "currency": {
      "type": "string",
      "description": "ISO 4217 currency code."
    },
    "product_name": {
      "type": "string",
      "description": "Product Name of the Institution for this account, proprietary definition."
    },
    "cash_account_type": {
      "type": "string",
      "description": "ExternalCashAccountType1Code from ISO 20022 (e.g. CACC, CARD, SVGS), when reported by the institution."
    },
    "account_usage": {
      "type": "string",
      "description": "Usage of the account: PRIV (private personal account) or ORGA (professional account)."
    },
    "linked_accounts": {
      "type": "string",
      "description": "Name of a cash account associated to pending card transactions, when the institution reports one. Banks often put that account's number here, so it is omitted with the other identifiers."
    },
    "details": {
      "type": "string",
      "description": "Specifications that might be provided by the financial institution - characteristics of the account - characteristics of the relevant card."
    },
    "msisdn": {
      "type": "string",
      "description": "An alias to a payment account via a registered mobile phone number."
    },
    "integrator_id": {
      "type": "string",
      "description": "The financial account ID provided by the integrator."
    },
    "institution_id": {
      "type": "string",
      "description": "The financial account ID provided by the institution/bank."
    },
    "details_last_synced_at": {
      "type": "string",
      "description": "Last time the financial account details were fetched from the integrator."
    },
    "transactions_last_synced_at": {
      "type": "string",
      "description": "Last time the financial account transactions were fetched from the integrator."
    },
    "transactions_backfill_cursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "History is fetched newest-first in windows of up to 90 days. While older\nwindows are still being fetched this is the earliest date already covered;\ntransactions before it arrive on subsequent syncs, at the pace the\ninstitution's daily request allowance permits. Null once the account's\nfull history (up to the connection's `max_historical_days`) is in."
    },
    "balances_last_synced_at": {
      "type": "string",
      "description": "Last time the financial account balances were fetched from the integrator."
    },
    "balance": {
      "type": "object",
      "description": "Balance of the account at the last sync. To get all types of balances at different dates, use the balances endpoints.",
      "properties": {
        "available": {
          "type": "number",
          "description": "The available balance. Left out when the institution reports none; a balance of 0 is sent as 0."
        },
        "cleared": {
          "type": "number",
          "description": "The cleared (booked) balance. Left out when the institution reports none; a balance of 0 is sent as 0."
        },
        "currency": {
          "type": "string",
          "description": "ISO 4217 currency of these figures. Only differs from the\naccount's `currency` on a multi-currency account (`XXX`),\nwhich holds a balance per currency: this is the one shown."
        },
        "cleared_type": {
          "type": [
            "string",
            "null"
          ],
          "description": "The balance type `cleared` was read from (e.g. `INTERIM_BOOKED`). Null when `cleared` is left out.\nFollows the account's `config.cleared_balance_type` when the user chose one."
        },
        "available_type": {
          "type": [
            "string",
            "null"
          ],
          "description": "The balance type `available` was read from. A cleared type when the institution reports no available\nbalance. Null when `available` is left out."
        },
        "by_type": {
          "type": "array",
          "description": "The latest balance of each type the institution reported, in `currency`: cleared types first, then\navailable ones. Some cards report the amount owed under a type other than the one `cleared` uses;\nset `config.cleared_balance_type` to one of these types to use it instead. Empty for accounts\nwithout bank balances, such as brokerage accounts.",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "category": {
                "type": "string"
              },
              "amount": {
                "type": "number"
              },
              "reference_date": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "type",
              "category",
              "amount",
              "reference_date"
            ]
          }
        }
      },
      "required": [
        "currency",
        "cleared_type",
        "available_type",
        "by_type"
      ]
    },
    "rules": {
      "type": "array",
      "description": "The rules attached to this financial account",
      "items": {
        "type": "object",
        "properties": {
          "order": {
            "type": "integer"
          },
          "rule": {
            "type": "object",
            "additionalProperties": {}
          }
        },
        "required": [
          "order",
          "rule"
        ]
      }
    },
    "transfer_links": {
      "type": "array",
      "description": "Left out for tokens without the `transfer-links:read` scope.",
      "items": {
        "$ref": "#/$defs/TransferLinkResource"
      }
    },
    "transfer_links_count": {
      "type": "string",
      "description": "Left out for tokens without the `transfer-links:read` scope."
    },
    "created_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "enabled",
    "live",
    "integrator",
    "account_category",
    "raw_type",
    "cash_balance",
    "total_balance",
    "meta",
    "mask",
    "name",
    "custom_name",
    "institution_name",
    "display_name",
    "currency",
    "product_name",
    "cash_account_type",
    "account_usage",
    "details",
    "details_last_synced_at",
    "transactions_last_synced_at",
    "transactions_backfill_cursor",
    "balances_last_synced_at",
    "balance",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "FinancialAccountResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "financial_connection_id": {
          "type": "string"
        },
        "financial_connection": {
          "$ref": "#/$defs/FinancialConnectionResource"
        },
        "config": {
          "description": "The financial account configuration. If the financial account has no configuration, the banks default configuration will be used.",
          "$ref": "#/$defs/InstitutionConfigResource"
        },
        "health": {
          "$ref": "#/$defs/HealthResource"
        },
        "enabled": {
          "type": "string"
        },
        "live": {
          "type": "string",
          "description": "Whether the account is in use: it AND its connection are enabled. A disabled connection keeps each\naccount's own `enabled` as the user set it, but none of its accounts sync until it is enabled again."
        },
        "integrator": {
          "type": "string",
          "description": "Provider that populates this account (GOCARDLESS / AKAHU / SNAPTRADE / ARRAY), or MANUAL for an account the user keeps by hand."
        },
        "account_category": {
          "type": [
            "string",
            "null"
          ],
          "description": "High-level kind of account: BANK (checking/savings, provided by\nbanking providers), INVESTMENT (brokerage), DEPOSIT (cash\nsub-account at a broker), LOC (line of credit), LOAN (a manual\nloan Synci models from its terms). Determines which fields are\npopulated on the account."
        },
        "loan": {
          "type": [
            "array",
            "null"
          ],
          "description": "The loan terms, rate history and derived figures. Present on LOAN accounts only.",
          "items": {}
        },
        "investment": {
          "type": [
            "array",
            "null"
          ],
          "description": "How a manual INVESTMENT account is set up and how fresh its prices are. Present on manual investment accounts only.",
          "items": {}
        },
        "raw_type": {
          "type": "string",
          "description": "Provider's free-form sub-type label (SnapTrade only). Examples:\n\"Roth IRA\", \"TFSA\", \"Cash\". Null for bank accounts."
        },
        "cash_balance": {
          "type": [
            "object",
            "null"
          ],
          "description": "Uninvested cash held at the broker, for INVESTMENT accounts.\nNull for bank accounts.",
          "properties": {
            "amount": {
              "type": "string"
            },
            "currency": {
              "type": "string"
            }
          },
          "required": [
            "amount",
            "currency"
          ]
        },
        "total_balance": {
          "type": [
            "object",
            "null"
          ],
          "description": "Broker-reported total account value (positions + cash) for\nINVESTMENT accounts. Brokerages report this on the account\npayload rather than as a dated snapshot, so it does not appear\nin the balances endpoint. Null for bank accounts.",
          "properties": {
            "amount": {
              "type": "string"
            },
            "currency": {
              "type": "string"
            }
          },
          "required": [
            "amount",
            "currency"
          ]
        },
        "meta": {
          "type": "string",
          "description": "Provider-specific extras that don't fit anywhere else (e.g.\nSnapTrade's `meta.type`/`meta.status` for crypto exchanges).\nTreat as opaque — schema is provider-defined."
        },
        "account_number_masked": {
          "type": "string",
          "description": "Masked account number (e.g. \"****1234\"). Only present when the\nprovider supplies it (SnapTrade brokerages, and banks that report\na masked card PAN via GoCardless); null otherwise."
        },
        "mask": {
          "type": "string",
          "description": "Last four digits of the card or account number (e.g. \"1234\"), for telling a user's accounts apart. Taken\nfrom the masked card number, else the account number or IBAN. Sent to every app, without `sensitive:read`.\nNull when the institution reports no number, as for some savings pots and brokerage accounts."
        },
        "name": {
          "type": "string",
          "description": "Name of the account, as assigned by the financial institution."
        },
        "custom_name": {
          "type": "string",
          "description": "Custom name for the account, as defined by the end user."
        },
        "institution_name": {
          "type": "string",
          "description": "The lender's name on a manual account, as the user entered it. Null on provider accounts and on manual\naccounts without one: group those under their connection's institution (\"Manual accounts\")."
        },
        "display_name": {
          "type": "string",
          "description": "Name of the account as defined by the end user within online channels."
        },
        "bban": {
          "type": "string",
          "description": "Basic Bank Account Number (BBAN)."
        },
        "scan": {
          "type": "string",
          "description": "UK SortCodeAccountNumber (6 digit sort code + 8 digit account number), reported by some UK banks."
        },
        "iban": {
          "type": "string",
          "description": "International Bank Account Number (IBAN)."
        },
        "bic": {
          "type": "string",
          "description": "Bank Identifier Code (BIC/SWIFT) associated with the account."
        },
        "owner_name": {
          "type": "string",
          "description": "Name of the legal account owner. If there is more than one owner, then e.g. two names might be noted here. For a corporate account, the corporate name is used for this attribute."
        },
        "owner_address": {
          "type": "string",
          "description": "Address of the legal account owner, when reported by the institution."
        },
        "currency": {
          "type": "string",
          "description": "ISO 4217 currency code."
        },
        "product_name": {
          "type": "string",
          "description": "Product Name of the Institution for this account, proprietary definition."
        },
        "cash_account_type": {
          "type": "string",
          "description": "ExternalCashAccountType1Code from ISO 20022 (e.g. CACC, CARD, SVGS), when reported by the institution."
        },
        "account_usage": {
          "type": "string",
          "description": "Usage of the account: PRIV (private personal account) or ORGA (professional account)."
        },
        "linked_accounts": {
          "type": "string",
          "description": "Name of a cash account associated to pending card transactions, when the institution reports one. Banks often put that account's number here, so it is omitted with the other identifiers."
        },
        "details": {
          "type": "string",
          "description": "Specifications that might be provided by the financial institution - characteristics of the account - characteristics of the relevant card."
        },
        "msisdn": {
          "type": "string",
          "description": "An alias to a payment account via a registered mobile phone number."
        },
        "integrator_id": {
          "type": "string",
          "description": "The financial account ID provided by the integrator."
        },
        "institution_id": {
          "type": "string",
          "description": "The financial account ID provided by the institution/bank."
        },
        "details_last_synced_at": {
          "type": "string",
          "description": "Last time the financial account details were fetched from the integrator."
        },
        "transactions_last_synced_at": {
          "type": "string",
          "description": "Last time the financial account transactions were fetched from the integrator."
        },
        "transactions_backfill_cursor": {
          "type": [
            "string",
            "null"
          ],
          "description": "History is fetched newest-first in windows of up to 90 days. While older\nwindows are still being fetched this is the earliest date already covered;\ntransactions before it arrive on subsequent syncs, at the pace the\ninstitution's daily request allowance permits. Null once the account's\nfull history (up to the connection's `max_historical_days`) is in."
        },
        "balances_last_synced_at": {
          "type": "string",
          "description": "Last time the financial account balances were fetched from the integrator."
        },
        "balance": {
          "type": "object",
          "description": "Balance of the account at the last sync. To get all types of balances at different dates, use the balances endpoints.",
          "properties": {
            "available": {
              "type": "number",
              "description": "The available balance. Left out when the institution reports none; a balance of 0 is sent as 0."
            },
            "cleared": {
              "type": "number",
              "description": "The cleared (booked) balance. Left out when the institution reports none; a balance of 0 is sent as 0."
            },
            "currency": {
              "type": "string",
              "description": "ISO 4217 currency of these figures. Only differs from the\naccount's `currency` on a multi-currency account (`XXX`),\nwhich holds a balance per currency: this is the one shown."
            },
            "cleared_type": {
              "type": [
                "string",
                "null"
              ],
              "description": "The balance type `cleared` was read from (e.g. `INTERIM_BOOKED`). Null when `cleared` is left out.\nFollows the account's `config.cleared_balance_type` when the user chose one."
            },
            "available_type": {
              "type": [
                "string",
                "null"
              ],
              "description": "The balance type `available` was read from. A cleared type when the institution reports no available\nbalance. Null when `available` is left out."
            },
            "by_type": {
              "type": "array",
              "description": "The latest balance of each type the institution reported, in `currency`: cleared types first, then\navailable ones. Some cards report the amount owed under a type other than the one `cleared` uses;\nset `config.cleared_balance_type` to one of these types to use it instead. Empty for accounts\nwithout bank balances, such as brokerage accounts.",
              "items": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "category": {
                    "type": "string"
                  },
                  "amount": {
                    "type": "number"
                  },
                  "reference_date": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "type",
                  "category",
                  "amount",
                  "reference_date"
                ]
              }
            }
          },
          "required": [
            "currency",
            "cleared_type",
            "available_type",
            "by_type"
          ]
        },
        "rules": {
          "type": "array",
          "description": "The rules attached to this financial account",
          "items": {
            "type": "object",
            "properties": {
              "order": {
                "type": "integer"
              },
              "rule": {
                "type": "object",
                "additionalProperties": {}
              }
            },
            "required": [
              "order",
              "rule"
            ]
          }
        },
        "transfer_links": {
          "type": "array",
          "description": "Left out for tokens without the `transfer-links:read` scope.",
          "items": {
            "$ref": "#/$defs/TransferLinkResource"
          }
        },
        "transfer_links_count": {
          "type": "string",
          "description": "Left out for tokens without the `transfer-links:read` scope."
        },
        "created_at": {
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "enabled",
        "live",
        "integrator",
        "account_category",
        "raw_type",
        "cash_balance",
        "total_balance",
        "meta",
        "mask",
        "name",
        "custom_name",
        "institution_name",
        "display_name",
        "currency",
        "product_name",
        "cash_account_type",
        "account_usage",
        "details",
        "details_last_synced_at",
        "transactions_last_synced_at",
        "transactions_backfill_cursor",
        "balances_last_synced_at",
        "balance",
        "created_at",
        "updated_at"
      ],
      "title": "FinancialAccountResource"
    },
    "FinancialConnectionResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "institution_id": {
          "type": "string"
        },
        "region": {
          "type": "string",
          "description": "Residency region of the connection's data (`eu`, `us`), decided\nby the institution's provider when the connection was created."
        },
        "institution": {
          "$ref": "#/$defs/InstitutionResource"
        },
        "enabled": {
          "type": "string"
        },
        "health": {
          "$ref": "#/$defs/HealthResource"
        },
        "status": {
          "type": [
            "string",
            "null"
          ],
          "description": "Provider-neutral lifecycle status (PENDING_AUTHORIZATION / CONNECTED / ...)."
        },
        "status_message": {
          "type": "string",
          "description": "Provider status message."
        },
        "sync_balances": {
          "type": "string",
          "description": "Whether balances should be synced. Applies to all accounts belonging to this connection."
        },
        "supports_reauthorization": {
          "type": "boolean",
          "description": "Whether `PUT /reauthorize` will start a fresh OAuth flow against this connection's\nprovider. True for every currently supported provider (GoCardless renews PSD2 consent;\nAkahu and SnapTrade re-grant a previously-disabled connection). When false, the\nreauthorize endpoint responds with `REAUTHORIZATION_NOT_SUPPORTED`."
        },
        "supports_manage": {
          "type": "boolean",
          "description": "Whether GET /manage will return a URL you can redirect the user to so\nthey can manage their existing connections directly with the provider. Currently\ntrue for Akahu (sends them to oauth.akahu.nz where they can add / revoke banks\nunder their enduring consent), false for GoCardless and SnapTrade."
        },
        "max_historical_days": {
          "type": [
            "string",
            "null"
          ],
          "description": "The maximum number of days of historical data Synci is able to fetch. Applies to all accounts belonging to this connection."
        },
        "access_valid_for_days": {
          "type": [
            "string",
            "null"
          ],
          "description": "Also known as consent lifetime. The number of days Synci is able to access accounts belonging to this connection.\nE.g. if this is set to 180 days, you will have to re-authenticate the connection every 180 days.\nSynci will send you an email when the expiry date is approaching."
        },
        "consent_expires_at": {
          "type": [
            "string",
            "null"
          ],
          "description": "The date and time when the bank consent expires and the connection\nhas to be reauthorized, or null for providers that grant enduring\nconsent (Akahu, SnapTrade)."
        },
        "reference": {
          "type": "string",
          "description": "Caller-supplied correlation id set at creation (e.g. a platform\ndeveloper's own end-user id). Filterable via ?filter[reference]=."
        },
        "accounts_last_synced_at": {
          "type": "string"
        },
        "setup_pending": {
          "type": "boolean",
          "description": "Whether the post-connection setup (choosing accounts, naming them,\npicking a sync start date) is still to be finished. While true the\naccounts exist but their first transaction sync is held back until\n`POST /setup/complete`, or until the setup goes stale. Always false\nfor connections created by API clients."
        },
        "setup_renewal": {
          "type": "boolean",
          "description": "True while a pending setup belongs to a consent renewal rather than a new connection: only the\naccount choice is asked for, and the accounts the user had enabled stay pre-selected."
        },
        "renewal_pending": {
          "type": "string",
          "description": "True while a renewal is waiting for the bank to confirm it. Until it does, the connection keeps syncing\non its current consent, and a user who backs out at the bank loses nothing."
        },
        "activated_at": {
          "type": "string",
          "description": "When the connection first went live (provider callback succeeded).\nNull while consent is still pending or the flow was abandoned."
        },
        "financial_accounts": {
          "type": "array",
          "description": "Financial accounts belonging to this connection.",
          "items": {
            "$ref": "#/$defs/FinancialAccountResource"
          }
        },
        "financial_accounts_count": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "institution_id",
        "region",
        "enabled",
        "status",
        "status_message",
        "sync_balances",
        "supports_reauthorization",
        "supports_manage",
        "max_historical_days",
        "access_valid_for_days",
        "consent_expires_at",
        "reference",
        "accounts_last_synced_at",
        "setup_pending",
        "setup_renewal",
        "renewal_pending",
        "activated_at",
        "created_at",
        "updated_at"
      ],
      "title": "FinancialConnectionResource"
    },
    "GoogleSheetResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "connection_id": {
          "type": "string"
        },
        "connection": {
          "$ref": "#/$defs/GoogleSheetsConnectionResource"
        },
        "health": {
          "$ref": "#/$defs/HealthResource"
        },
        "name": {
          "type": "string",
          "description": "Display name of the spreadsheet in Synci."
        },
        "spreadsheet_id": {
          "type": "string",
          "description": "The spreadsheet's ID in Google Sheets, as found in its URL."
        },
        "spreadsheet_name": {
          "type": "string",
          "description": "The spreadsheet's title in Google Sheets."
        },
        "spreadsheet_url": {
          "type": "string",
          "description": "Link to open the spreadsheet in Google Sheets."
        },
        "is_synci_managed": {
          "type": "string",
          "description": "True when the spreadsheet was created by Synci; false when an existing spreadsheet was attached."
        },
        "transactions_sheet_gid": {
          "type": "string",
          "description": "The gid of the tab that receives transactions, if assigned."
        },
        "transactions_sheet_name": {
          "type": "string",
          "description": "The name of the tab that receives transactions, if assigned."
        },
        "live_balance_sheet_gid": {
          "type": "string",
          "description": "The gid of the tab that holds current balances, if assigned."
        },
        "live_balance_sheet_name": {
          "type": "string",
          "description": "The name of the tab that holds current balances, if assigned."
        },
        "balance_history_sheet_gid": {
          "type": "string",
          "description": "The gid of the tab that records balance history, if assigned."
        },
        "balance_history_sheet_name": {
          "type": "string",
          "description": "The name of the tab that records balance history, if assigned."
        },
        "transfer_links": {
          "type": "array",
          "description": "Left out for tokens without the `transfer-links:read` scope.",
          "items": {
            "$ref": "#/$defs/TransferLinkResource"
          }
        },
        "last_synced_at": {
          "type": "string",
          "description": "When data was last synced to the spreadsheet."
        },
        "created_at": {
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "connection_id",
        "name",
        "spreadsheet_id",
        "spreadsheet_name",
        "spreadsheet_url",
        "is_synci_managed",
        "transactions_sheet_gid",
        "transactions_sheet_name",
        "live_balance_sheet_gid",
        "live_balance_sheet_name",
        "balance_history_sheet_gid",
        "balance_history_sheet_name",
        "last_synced_at",
        "created_at",
        "updated_at"
      ],
      "title": "GoogleSheetResource"
    },
    "GoogleSheetsConnectionResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "health": {
          "$ref": "#/$defs/HealthResource"
        },
        "enabled": {
          "type": "string",
          "description": "Whether syncing through this connection is enabled."
        },
        "auth_url": {
          "type": "string",
          "description": "URL to authorize the connection with Google. Only present when authorization is required."
        },
        "google_email": {
          "type": "string",
          "description": "Email address of the connected Google account."
        },
        "sheets": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/GoogleSheetResource"
          }
        },
        "last_synced_at": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "enabled",
        "google_email",
        "last_synced_at",
        "created_at",
        "updated_at"
      ],
      "title": "GoogleSheetsConnectionResource"
    },
    "HealthResource": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "description": "Health status: HEALTHY (last request succeeded), FAILING (recent requests failed), or DEAD (10 or more consecutive failures)."
        },
        "integrator_message": {
          "type": "string",
          "description": "The most recent error message reported by the provider, if any."
        },
        "failure_count": {
          "type": "string",
          "description": "The number of consecutive failed requests."
        },
        "transient_message": {
          "type": "string",
          "description": "A provider-side outage currently blocking part of the sync (for example the institution being down for maintenance). Not counted as a failure: the status stays HEALTHY while Synci retries automatically. Null when nothing is being retried."
        },
        "transient_failure_count": {
          "type": "string",
          "description": "The number of consecutive sync attempts refused by that outage."
        },
        "last_attempt_at": {
          "type": "string",
          "description": "When the last sync attempt occurred."
        }
      },
      "required": [
        "status",
        "integrator_message",
        "failure_count",
        "transient_message",
        "transient_failure_count",
        "last_attempt_at"
      ],
      "title": "HealthResource"
    },
    "InstitutionConfigResource": {
      "type": "object",
      "properties": {
        "map_fields": {
          "type": "object",
          "description": "Which field(s) are used when mapping the \"payee\", \"description\" and \"date\" fields for a transaction.\nOne of the fixed option names (`AUTO`, `NONE`, `CREDITOR_NAME`, `BOOKING_DATE`, ...).\nVersion 2 of the API stores an ordered fallback chain per field instead; this is the closest fixed\noption for the stored chain, and a chain without an equivalent reads as `AUTO`.",
          "properties": {
            "payee": {
              "type": "string"
            },
            "description": {
              "type": "string"
            },
            "date": {
              "type": "string"
            }
          },
          "required": [
            "payee",
            "description",
            "date"
          ]
        },
        "enrichment": {
          "type": "object",
          "description": "Enrich transaction data with additional information from an external provider",
          "properties": {
            "enabled": {
              "type": "string",
              "description": "Whether transaction enrichment is enabled"
            },
            "provider": {
              "type": "string",
              "description": "The provider to use for transaction enrichment."
            },
            "country": {
              "type": "string",
              "description": "The country where transactions are made. Providing a country significantly improves enrichment accuracy."
            }
          },
          "required": [
            "enabled",
            "provider",
            "country"
          ]
        },
        "sync_start_date": {
          "type": [
            "string",
            "null"
          ],
          "description": "The date to start syncing transactions from.\nCannot be earlier than the date the connection was authorized minus the connection's `max_historical_days`.\nWill default to today if not set."
        },
        "sync_auto": {
          "type": "string",
          "description": "Whether data should be synced automatically. If set to false, you will need to manually trigger a sync every time you want to refresh data."
        },
        "sync_pending_transactions": {
          "type": "string",
          "description": "Whether pending transactions should be synced. For some banks, setting this to true can cause duplicate transactions."
        },
        "pending_settlement_matching": {
          "type": "string",
          "description": "Whether a booked transaction can settle an existing pending transaction when the amount changed.\nCard pre-authorizations (fuel stations, hotels, car rentals) are often authorized with a placeholder amount\nthat changes when the transaction is booked, together with the transaction's identifiers.\nWhen enabled, a booked transaction that matches a pending transaction's counterparty (and card details,\nwhen the bank provides them) within `pending_settlement_max_days` days updates that pending transaction\ninstead of creating a duplicate.\nOnly pending transactions are matched this way; deduplication of booked transactions is unaffected.\nEnabled by default; `null` means the default applies."
        },
        "pending_settlement_max_days": {
          "type": "string",
          "description": "The maximum number of days between a pending transaction and its booked settlement\nfor `pending_settlement_matching` to link the two. Defaults to 7; `null` means the default applies."
        },
        "fuzzy_counterparty_matching": {
          "type": "string",
          "description": "Whether a counterparty name the bank re-words when a transaction settles can still match\nthe pending entry it replaces (\"NORWEGIAN.COM\" settling as \"NORWEGIAN.C 3284405123\").\nDescriptors that conflict rather than truncate or extend never match, and only pending\ntransactions are matched this way.\nEnabled by default; `null` means the default applies."
        },
        "fuzzy_counterparty_min_chars": {
          "type": "string",
          "description": "The minimum number of characters two re-worded counterparty descriptors must align on for\n`fuzzy_counterparty_matching` to treat them as the same party. Defaults to 6; `null` means\nthe default applies."
        },
        "sync_balances": {
          "type": "string",
          "description": "Whether balances should be synced."
        },
        "cleared_balance_type": {
          "type": [
            "string",
            "null"
          ],
          "description": "Accounts only: the balance type `balance.cleared` is read from, chosen by the user. One of the types in the\naccount's `balance.by_type`, for cards that report the amount owed under a type other than the one Synci\npicks. `null` keeps the automatic order. The newest balance of this type is used; until the bank has reported\none, the automatic order applies. `balance.available` is not affected."
        },
        "sync_frequency_in_minutes": {
          "type": "string",
          "description": "How often to sync data, in minutes. The permitted minimum is set by the\nsubscriber's plan (`max_sync_frequency_minutes` in the plan's features, see\n`GET /billing/plans`); 30 is only the absolute lower bound any plan could set. This is the CONFIGURED value. The interval actually used may be longer if the\ninstitution has refused requests on its own daily cap, in which case the account\nis demoted to a slower cadence automatically."
        },
        "fields_for_duplicate_filtering": {
          "type": [
            "array",
            "null"
          ],
          "description": "An array of Transaction fields to use when filtering duplicate transactions.\nWhen a new transaction is synced, these fields are compared with existing transactions.\nIf the fields are identical, the new transaction is considered a duplicate and will be ignored.\nThis should only be used if you are struggling with duplicate transactions, and know which fields can be used to filter them. For everyone else, omit this field.",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "map_fields",
        "enrichment",
        "sync_start_date",
        "sync_auto",
        "sync_pending_transactions",
        "pending_settlement_matching",
        "pending_settlement_max_days",
        "fuzzy_counterparty_matching",
        "fuzzy_counterparty_min_chars",
        "sync_balances",
        "sync_frequency_in_minutes"
      ],
      "title": "InstitutionConfigResource"
    },
    "InstitutionResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "integrator": {
          "type": "string",
          "description": "The integrator used to connect to this institution."
        },
        "region": {
          "type": "string",
          "description": "Residency region connections to this institution are stored in (`eu`, `us`)."
        },
        "country": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2 country code."
        },
        "name": {
          "type": "string",
          "description": "Name of the institution."
        },
        "bic": {
          "type": "string",
          "description": "Institution Identifier Code (BIC/SWIFT code)."
        },
        "external_id": {
          "type": "string",
          "description": "The ID of the institution as provided by the integrator."
        },
        "logo": {
          "type": "string",
          "description": "URL to the institution's logo, as provided by the integrator."
        },
        "supported": {
          "type": "string",
          "description": "Whether the institution is supported. Will be true in most cases, but might be false if the integrator stops supporting an institution."
        },
        "supports_pending_transactions": {
          "type": "string",
          "description": "Whether the institution supports pending transactions."
        },
        "supports_card_accounts": {
          "type": "string",
          "description": "Whether the institution supports card accounts."
        },
        "max_historical_days": {
          "type": "string",
          "description": "The maximum number of days of historical data this institution can provide.\n`null` where the provider imposes no such limit and fetches whatever the bank\nholds, which is the case for every US institution. Do not read null as zero."
        },
        "max_access_valid_for_days": {
          "type": "string",
          "description": "Also known as consent lifetime. The maximum number of days access to this institution may be valid for.\nFor most European institutions this ranges from 90 to 180 days. `null` where access does not\nexpire on a schedule and no periodic re-consent is required, which is the case for every US\ninstitution: those connections break only when the bank breaks them."
        },
        "supported_products": {
          "type": "string",
          "description": "The kinds of data this institution can serve, e.g. `[\"ACCOUNTS\", \"TRANSACTIONS\", \"INVESTMENTS\"]`.\n`null` means the provider does not report it, NOT that the institution serves nothing: treat it\nas no information rather than as a negative. Only US institutions report it today."
        },
        "category": {
          "type": [
            "string",
            "null"
          ],
          "description": "The category of the financial institution."
        },
        "updated_at": {
          "type": "string",
          "description": "The date and time when the institution was last updated."
        }
      },
      "required": [
        "id",
        "integrator",
        "region",
        "country",
        "name",
        "bic",
        "external_id",
        "logo",
        "supported",
        "supports_pending_transactions",
        "supports_card_accounts",
        "max_historical_days",
        "max_access_valid_for_days",
        "supported_products",
        "category",
        "updated_at"
      ],
      "title": "InstitutionResource"
    },
    "LunchMoneyAccountResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "connection_id": {
          "type": "string"
        },
        "connection": {
          "$ref": "#/$defs/LunchMoneyConnectionResource"
        },
        "health": {
          "$ref": "#/$defs/HealthResource"
        },
        "lunch_money_id": {
          "type": "string",
          "description": "The account's ID in Lunch Money."
        },
        "name": {
          "type": "string"
        },
        "display_name": {
          "type": "string",
          "description": "The account's display name in Lunch Money, if set."
        },
        "type": {
          "type": "string",
          "description": "The account type as reported by Lunch Money, e.g. \"cash\" or \"credit\"."
        },
        "subtype": {
          "type": "string",
          "description": "The account subtype as reported by Lunch Money, if set."
        },
        "currency": {
          "type": "string"
        },
        "balance": {
          "type": "string",
          "description": "The account balance as reported by Lunch Money."
        },
        "balance_as_of": {
          "type": "string",
          "description": "When the balance was last updated in Lunch Money."
        },
        "closed_on": {
          "type": "string",
          "description": "When the account was closed in Lunch Money, if closed."
        },
        "exclude_from_transactions": {
          "type": "string",
          "description": "Whether the account is excluded from transactions in Lunch Money."
        },
        "transfer_links": {
          "type": "array",
          "description": "Left out for tokens without the `transfer-links:read` scope.",
          "items": {
            "$ref": "#/$defs/TransferLinkResource"
          }
        },
        "created_at": {
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "connection_id",
        "lunch_money_id",
        "name",
        "display_name",
        "type",
        "subtype",
        "currency",
        "balance",
        "balance_as_of",
        "closed_on",
        "exclude_from_transactions",
        "created_at",
        "updated_at"
      ],
      "title": "LunchMoneyAccountResource"
    },
    "LunchMoneyConnectionResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "health": {
          "$ref": "#/$defs/HealthResource"
        },
        "name": {
          "type": "string",
          "description": "The name of the connected Lunch Money budget."
        },
        "lunch_money_details": {
          "type": "object",
          "description": "Details about the connected Lunch Money account.",
          "properties": {
            "user_name": {
              "type": "string",
              "description": "Name of the Lunch Money user."
            },
            "user_email": {
              "type": "string",
              "description": "Email address of the Lunch Money user."
            },
            "user_id": {
              "type": "string",
              "description": "The user's ID in Lunch Money."
            },
            "bank_account_id": {
              "type": "string",
              "description": "The connected account's ID in Lunch Money."
            },
            "budget_name": {
              "type": "string",
              "description": "Name of the connected Lunch Money budget."
            },
            "primary_currency": {
              "type": "string",
              "description": "The budget's primary currency in Lunch Money."
            },
            "api_key_label": {
              "type": "string",
              "description": "Label of the Lunch Money API token used by this connection, if set."
            }
          },
          "required": [
            "user_name",
            "user_email",
            "user_id",
            "bank_account_id",
            "budget_name",
            "primary_currency",
            "api_key_label"
          ]
        },
        "enabled": {
          "type": "string",
          "description": "Whether syncing through this connection is enabled."
        },
        "sync_balances": {
          "type": "string",
          "description": "Whether account balances are synced to Lunch Money."
        },
        "sync_transactions": {
          "type": "string",
          "description": "Whether transactions are synced to Lunch Money."
        },
        "last_synced_at": {
          "type": "string"
        },
        "accounts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/LunchMoneyAccountResource"
          }
        },
        "created_at": {
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "lunch_money_details",
        "enabled",
        "sync_balances",
        "sync_transactions",
        "last_synced_at",
        "created_at",
        "updated_at"
      ],
      "title": "LunchMoneyConnectionResource"
    },
    "NotionConnectionResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "health": {
          "$ref": "#/$defs/HealthResource"
        },
        "enabled": {
          "type": "string",
          "description": "Whether syncing through this connection is enabled."
        },
        "auth_url": {
          "type": "string",
          "description": "URL to authorize the connection with Notion. Only present when authorization is required."
        },
        "workspace_id": {
          "type": "string",
          "description": "The connected Notion workspace."
        },
        "workspace_name": {
          "type": "string"
        },
        "workspace_icon": {
          "type": "string",
          "description": "Emoji or image URL of the workspace icon, if any."
        },
        "owner_email": {
          "type": "string",
          "description": "Email of the Notion user who authorized the connection, when shared."
        },
        "duplicated_template_id": {
          "type": "string",
          "description": "The page Notion created when the user duplicated the Synci template during authorization, if any."
        },
        "databases": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/NotionDatabaseResource"
          }
        },
        "last_synced_at": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "enabled",
        "workspace_id",
        "workspace_name",
        "workspace_icon",
        "owner_email",
        "duplicated_template_id",
        "last_synced_at",
        "created_at",
        "updated_at"
      ],
      "title": "NotionConnectionResource"
    },
    "NotionDatabaseResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "connection_id": {
          "type": "string"
        },
        "connection": {
          "$ref": "#/$defs/NotionConnectionResource"
        },
        "health": {
          "$ref": "#/$defs/HealthResource"
        },
        "name": {
          "type": "string",
          "description": "Display name of the database in Synci."
        },
        "title": {
          "type": "string",
          "description": "The database's title in Notion."
        },
        "database_id": {
          "type": "string",
          "description": "The Notion database ID."
        },
        "data_source_id": {
          "type": "string",
          "description": "The Notion data source (table) transactions are written to."
        },
        "database_url": {
          "type": "string",
          "description": "Link to open the database in Notion."
        },
        "parent_page_id": {
          "type": "string",
          "description": "The Notion page the database lives under, when known, and its title\n(a dashboard's `name` falls back to this)."
        },
        "parent_page_title": {
          "type": "string"
        },
        "is_synci_managed": {
          "type": "string",
          "description": "True when the database was created by Synci; false when an existing database was attached."
        },
        "layout": {
          "type": "string",
          "description": "\"dashboard\" when the Synci Finance template was adopted (transactions relate to Accounts,\nCategories and Months); \"flat\" for plain databases."
        },
        "header_config": {
          "type": "string",
          "description": "Ordered list of transaction field keys written as database properties."
        },
        "property_map": {
          "type": "string",
          "description": "Field key to Notion property id map Synci writes through."
        },
        "accounts_database_id": {
          "type": "string",
          "description": "The supporting databases next to this one, when present."
        },
        "categories_database_id": {
          "type": "string"
        },
        "months_database_id": {
          "type": "string"
        },
        "balance_history_database_id": {
          "type": "string"
        },
        "balance_available": {
          "type": "string",
          "description": "Whether balance databases exist or can be provisioned (requires a parent page)."
        },
        "transfer_links": {
          "type": "array",
          "description": "Left out for tokens without the `transfer-links:read` scope.",
          "items": {
            "$ref": "#/$defs/TransferLinkResource"
          }
        },
        "last_synced_at": {
          "type": "string",
          "description": "When data was last synced to the database."
        },
        "created_at": {
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "connection_id",
        "name",
        "title",
        "database_id",
        "data_source_id",
        "database_url",
        "parent_page_id",
        "parent_page_title",
        "is_synci_managed",
        "layout",
        "header_config",
        "property_map",
        "accounts_database_id",
        "categories_database_id",
        "months_database_id",
        "balance_history_database_id",
        "balance_available",
        "last_synced_at",
        "created_at",
        "updated_at"
      ],
      "title": "NotionDatabaseResource"
    },
    "TransferLinkResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "financial_account_id": {
          "type": "string",
          "description": "The ID of the financial account transactions are being transferred from."
        },
        "financial_account": {
          "description": "The associated FinancialAccount resource. Will be included in the response if the `include` query parameter contains `financial_account`.",
          "$ref": "#/$defs/FinancialAccountResource"
        },
        "destination_type": {
          "type": "string",
          "description": "The type of destination the transfer link sends transactions to:\n- **YNAB**: a YNAB budget account.\n- **LUNCH_MONEY**: a Lunch Money account.\n- **GOOGLE_SHEETS**: a Google Sheet.\n- **NOTION**: a Notion database."
        },
        "destination_id": {
          "type": "string",
          "description": "The ID of the destination transactions are being transferred to. The type of resource the ID refers to depends on the destination type:\n- **YNAB**: the ID of a YNAB budget account.\n- **LUNCH_MONEY**: the ID of a Lunch Money account.\n- **GOOGLE_SHEETS**: the ID of a Google Sheet.\n- **NOTION**: the ID of a Notion database."
        },
        "destination": {
          "description": "The associated destination resource. Will be included in the response if the `include` query parameter contains `destination`.",
          "anyOf": [
            {
              "$ref": "#/$defs/YnabBudgetAccountResource"
            },
            {
              "$ref": "#/$defs/LunchMoneyAccountResource"
            },
            {
              "$ref": "#/$defs/GoogleSheetResource"
            },
            {
              "$ref": "#/$defs/NotionDatabaseResource"
            },
            {
              "type": "null"
            }
          ]
        },
        "transfer_start_date": {
          "type": "string",
          "description": "The date from which the transfer link will start transferring transactions.\nIf not provided, all available transactions in the attached financial account will be transferred regardless of their date."
        },
        "active": {
          "type": "string",
          "description": "Whether the transfer link is enabled."
        },
        "sync_mode": {
          "type": "string",
          "description": "Which streams to push to the destination:\n- `transactions`: only individual transactions (default for bank sources)\n- `balance`: only periodic balance snapshots\n- `transactions_and_balance`: both (default for brokerage / crypto sources)"
        },
        "on_booked_change": {
          "type": "object",
          "description": "Which destination fields to update when a transaction's booked status changes.\nIf not provided, all fields will be updated.",
          "properties": {
            "update_status": {
              "type": "string"
            },
            "update_payee": {
              "type": "string"
            },
            "update_description": {
              "type": "string"
            },
            "update_amount": {
              "type": "string"
            }
          },
          "required": [
            "update_status",
            "update_payee",
            "update_description",
            "update_amount"
          ]
        },
        "rules": {
          "type": "array",
          "description": "The rules attached to the transfer link. Will be included in the response if the `include` query parameter contains `rules`.\nEach object includes:\n- order: The position of the rule in the transfer link's rule list. Rules are applied in ascending order.\n- rule: The rule resource data",
          "items": {
            "type": "object",
            "properties": {
              "order": {
                "type": "integer"
              },
              "rule": {
                "type": "object",
                "additionalProperties": {}
              }
            },
            "required": [
              "order",
              "rule"
            ]
          }
        },
        "created_at": {
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "financial_account_id",
        "destination_type",
        "destination_id",
        "transfer_start_date",
        "active",
        "sync_mode",
        "on_booked_change",
        "created_at",
        "updated_at"
      ],
      "title": "TransferLinkResource"
    },
    "YnabBudgetAccountResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "budget_id": {
          "type": "string"
        },
        "budget": {
          "$ref": "#/$defs/YnabBudgetResource"
        },
        "ynab_id": {
          "type": "string",
          "description": "The account's ID in YNAB."
        },
        "health": {
          "$ref": "#/$defs/HealthResource"
        },
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "on_budget": {
          "type": "string",
          "description": "Whether the account is on budget in YNAB."
        },
        "closed": {
          "type": "string",
          "description": "Whether the account is closed in YNAB."
        },
        "note": {
          "type": "string",
          "description": "The account note from YNAB, if set."
        },
        "balance": {
          "type": "string",
          "description": "The account balance as reported by YNAB."
        },
        "cleared_balance": {
          "type": "string",
          "description": "The cleared balance as reported by YNAB."
        },
        "uncleared_balance": {
          "type": "string",
          "description": "The uncleared balance as reported by YNAB."
        },
        "transfer_payee_id": {
          "type": "string",
          "description": "The YNAB payee ID used for transfers to this account."
        },
        "direct_import_linked": {
          "type": "string",
          "description": "Whether the account is linked to YNAB Direct Import."
        },
        "last_reconciled_at": {
          "type": "string",
          "description": "When the account was last reconciled in YNAB."
        },
        "transfer_links": {
          "type": "array",
          "description": "Left out for tokens without the `transfer-links:read` scope.",
          "items": {
            "$ref": "#/$defs/TransferLinkResource"
          }
        },
        "created_at": {
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "budget_id",
        "ynab_id",
        "name",
        "type",
        "on_budget",
        "closed",
        "note",
        "balance",
        "cleared_balance",
        "uncleared_balance",
        "transfer_payee_id",
        "direct_import_linked",
        "last_reconciled_at",
        "created_at",
        "updated_at"
      ],
      "title": "YnabBudgetAccountResource"
    },
    "YnabBudgetResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "connection_id": {
          "type": "string"
        },
        "connection": {
          "$ref": "#/$defs/YnabConnectionResource"
        },
        "ynab_id": {
          "type": "string",
          "description": "The budget's ID in YNAB."
        },
        "enabled": {
          "type": "string",
          "description": "Whether syncing to this budget is enabled."
        },
        "name": {
          "type": "string"
        },
        "currency": {
          "type": "string",
          "description": "The budget's currency in YNAB."
        },
        "first_month": {
          "type": "string",
          "description": "The budget's first month in YNAB."
        },
        "last_month": {
          "type": "string",
          "description": "The budget's last month in YNAB."
        },
        "accounts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/YnabBudgetAccountResource"
          }
        },
        "last_synced_at": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "connection_id",
        "ynab_id",
        "enabled",
        "name",
        "currency",
        "first_month",
        "last_month",
        "last_synced_at",
        "created_at",
        "updated_at"
      ],
      "title": "YnabBudgetResource"
    },
    "YnabConnectionResource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "health": {
          "$ref": "#/$defs/HealthResource"
        },
        "enabled": {
          "type": "string",
          "description": "Whether syncing through this connection is enabled."
        },
        "auth_url": {
          "type": "string",
          "description": "URL to authorize the connection with YNAB. Only present when authorization is required."
        },
        "sync_balances": {
          "type": "string",
          "description": "Whether account balances are synced to YNAB."
        },
        "ynab_user_id": {
          "type": "string",
          "description": "The connected user's ID in YNAB."
        },
        "budgets": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/YnabBudgetResource"
          }
        },
        "last_synced_at": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "enabled",
        "sync_balances",
        "ynab_user_id",
        "last_synced_at",
        "created_at",
        "updated_at"
      ],
      "title": "YnabConnectionResource"
    }
  }
}