{"openapi":"3.1.0","info":{"title":"Redbark API","version":"2026-10-01.wattle","description":"Everything a user can do in the dashboard, by API key. Send `Redbark-Version` on every request; see the conventions guide for ids, lists, errors and idempotency."},"servers":[{"url":"https://api.redbark.com/v2"}],"security":[{"Bearer":[],"RedbarkVersion":[]}],"tags":[{"name":"Account","description":"The authenticated account, its plan and the key in use."},{"name":"API keys","description":"Create, scope, rotate and revoke API keys."},{"name":"Connections","description":"Linked banks and brokerages, and their lifecycle."},{"name":"Consents","description":"Open Banking consents behind each connection."},{"name":"Accounts","description":"Bank and brokerage accounts, live balances and details."},{"name":"Transactions","description":"Transactions read live from the provider."},{"name":"Holdings","description":"Brokerage positions."},{"name":"Trades","description":"Brokerage trade history."},{"name":"Categories","description":"The category taxonomy and provider categories."},{"name":"Syncs","description":"Syncs from accounts to destinations."},{"name":"Sync runs","description":"Individual sync executions."},{"name":"Rules","description":"Rulesets and rules that transform transactions during a sync."},{"name":"Destinations","description":"Where synced data lands: Sheets, Airtable, Notion, YNAB, webhooks."},{"name":"Link sessions","description":"Hosted flows that connect a bank or brokerage."},{"name":"Destination links","description":"Hosted flows that authorise a destination."},{"name":"Institutions","description":"Banks available to link."},{"name":"Event destinations","description":"Endpoints that receive signed events."},{"name":"Events","description":"What happened, and redelivery."}],"components":{"securitySchemes":{"Bearer":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"Authorization: Bearer rbk_live_..."},"RedbarkVersion":{"type":"apiKey","in":"header","name":"Redbark-Version","description":"The API release your integration is built against, e.g. 2026-10-01.wattle. Required on every request."}},"schemas":{"Account":{"type":"object","properties":{"id":{"type":"string","example":"acc_5c9bQm2vT1xWz8nR4pLk7D"},"object":{"type":"string","enum":["account"]},"email":{"type":["string","null"],"description":"The sign-in email. Null unless the credential holds account:read.","example":"jo@example.com"},"name":{"type":["string","null"],"description":"The display name as stored, or null. Null unless the credential holds account:read.","example":"Jo Citizen"},"first_name":{"type":["string","null"],"description":"The first word of `name`, or null. Null unless the credential holds account:read.","example":"Jo"},"last_name":{"type":["string","null"],"description":"The rest of `name` after the first word, or null. Null unless the credential holds account:read.","example":"Citizen"},"plan":{"type":"string","example":"developer"},"status":{"type":["string","null"]},"entitlements":{"type":"object","properties":{"api_access":{"type":"boolean"},"brokerage":{"type":"boolean"}},"required":["api_access","brokerage"]},"limits":{"type":"object","properties":{"connections":{"type":"integer","description":"-1 means unlimited"},"accounts":{"type":"integer"},"syncs":{"type":"integer"},"destinations":{"type":"integer"}},"required":["connections","accounts","syncs","destinations"]},"usage":{"type":"object","properties":{"connections":{"type":"integer","description":"Linked connections counted against the plan limit."},"accounts":{"type":"integer"},"brokerage_connections":{"type":"integer"}},"required":["connections","accounts","brokerage_connections"],"description":"Current resource usage, counted the same way plan fit is evaluated."},"plan_fit":{"type":"object","properties":{"plans":{"type":"array","items":{"type":"object","properties":{"plan":{"type":"string","enum":["saver","developer","professional"]},"fits":{"type":"boolean"},"reasons":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["connections","accounts","brokerage"],"description":"What the plan cannot hold. connections and accounts exceed the plan limit; brokerage means the plan includes no brokerage connections. More codes may be added."},"count":{"type":"integer","description":"Current usage of the resource."},"limit":{"type":"integer","description":"What the plan allows. 0 for brokerage on a plan without it."}},"required":["code","count","limit"]},"description":"Empty when the plan fits."}},"required":["plan","fits","reasons"]}},"recommended":{"type":"string","enum":["saver","developer","professional"],"description":"The cheapest paid plan the current usage fits."}},"required":["plans","recommended"],"description":"Whether each paid plan can hold the current usage. Evaluated on connections, accounts and brokerage connections; API activity is not considered."},"billing":{"type":"object","properties":{"source":{"type":"string","enum":["stripe","apple","none"],"description":"Where the subscription is managed: stripe (billed on the web), apple (billed through the App Store), or none (no billing record). More sources may be added; treat unknown values as opaque."},"interval":{"type":["string","null"],"enum":["month","year",null],"description":"Billing interval, or null without a subscription."},"period_end":{"type":["string","null"],"format":"date-time","example":"2026-08-21T09:30:00.000Z","description":"End of the current billing period, or null."},"trial_end":{"type":["string","null"],"format":"date-time","example":"2026-08-21T09:30:00.000Z","description":"When the trial ends, or null when not trialing."},"app_trial":{"type":"boolean","description":"True while the account is on a trial that was started from the app, whatever platform the account signed up on. The app uses it to offer the App Store subscription in its place."},"needs_plan":{"type":"boolean","description":"True for an account with no billing record that is not grandfathered, whatever platform it signed up on: it has never started a trial or subscription. The app shows its plan screen until one exists."},"paid_before":{"type":"boolean","description":"True when the subscription has ended and had been paid for, so it was not a trial that ran out. False while a subscription is live."},"grandfathered":{"type":"boolean","description":"True for a grandfathered account. It keeps API and app access whatever its subscription status."}},"required":["source","interval","period_end","trial_end","app_trial","needs_plan","paid_before","grandfathered"],"description":"Subscription details from the stored billing record."},"timezone":{"type":"string"},"api_version":{"type":"string"},"key":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Scope"}},"legacy":{"type":"boolean"}},"required":["id","name","scopes","legacy"],"description":"The calling API key, or null when authenticated with OAuth."},"livemode":{"type":"boolean"}},"required":["id","object","email","name","first_name","last_name","plan","status","entitlements","limits","usage","plan_fit","billing","timezone","api_version","key","livemode"]},"Scope":{"type":"string","enum":["account:read","connections:read","connections:write","data:read","categories:read","categories:write","destinations:read","destinations:write","syncs:read","syncs:write","rules:read","rules:write","events:read","events:write","keys:write"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","rate_limit_error","idempotency_error","upstream_error","api_error"]},"code":{"type":"string"},"message":{"type":"string"},"param":{"type":["string","null"]},"doc_url":{"type":"string"},"request_id":{"type":"string"}},"required":["type","code","message","param","doc_url","request_id"]}},"required":["error"]},"ApiKeyList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"ApiKey":{"type":"object","properties":{"id":{"type":"string","example":"key_3K1nTq8cZ5yWvR2mPd7Lx9"},"object":{"type":"string","enum":["api_key"]},"name":{"type":"string"},"prefix":{"type":"string","description":"First 16 characters of the secret, for display"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Scope"}},"legacy":{"type":"boolean","description":"Created before scopes existed; holds every :read scope"},"secret":{"type":["string","null"],"description":"Only present on create and rotate responses"},"allowed_ips":{"type":["array","null"],"items":{"type":"string"},"description":"IPv4 addresses or CIDRs and exact IPv6 addresses. IPv6 CIDR is not enforced and is rejected at create time. IPv6 entries are normalized to canonical RFC 5952 form (lowercase, compressed, no leading zeros) on write. Immutable after create."},"expires_at":{"type":["string","null"],"format":"date-time","example":"2026-08-21T09:30:00.000Z"},"expiring_at":{"type":["string","null"],"format":"date-time","example":"2026-08-21T09:30:00.000Z","description":"Set after rotate: when this key stops working"},"last_used_at":{"type":["string","null"],"format":"date-time","example":"2026-08-21T09:30:00.000Z"},"rotated_from":{"type":["string","null"]},"status":{"type":"string","enum":["active","expiring","revoked","expired"]},"metadata":{"type":["object","null"],"additionalProperties":{"type":"string","maxLength":500},"description":"Up to 50 string pairs. Set a key to null in an update to unset it."},"livemode":{"type":"boolean"},"created":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"},"updated":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"}},"required":["id","object","name","prefix","scopes","legacy","secret","allowed_ips","expires_at","expiring_at","last_used_at","rotated_from","status","metadata","livemode","created","updated"]},"CreateApiKey":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Scope"},"minItems":1},"allowed_ips":{"type":["array","null"],"items":{"type":"string"},"maxItems":20,"description":"IPv4 addresses or CIDRs and exact IPv6 addresses (no IPv6 CIDR). IPv6 entries are normalized to canonical RFC 5952 form on write. Up to 20 entries."},"expires_at":{"type":["string","null"],"format":"date-time","example":"2026-08-21T09:30:00.000Z"},"metadata":{"type":"object","additionalProperties":{"type":["string","null"],"maxLength":500},"description":"Up to 50 string pairs. Set a key to null to unset it."}},"required":["name","scopes"]},"UpdateApiKey":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"metadata":{"type":"object","additionalProperties":{"type":["string","null"],"maxLength":500},"description":"Up to 50 string pairs. Set a key to null to unset it."}}},"ConnectionList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Connection"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"Connection":{"type":"object","properties":{"id":{"type":"string","example":"conn_2Bc4De6fGh8jKl0mNp3qRs"},"object":{"type":"string","enum":["connection"]},"provider":{"anyOf":[{"type":"string","enum":["fiskil","akahu","snaptrade"]},{"type":"string"}]},"category":{"type":"string","enum":["banking","brokerage"]},"institution":{"type":"object","properties":{"id":{"type":"string","example":"inst_fk_anz"},"name":{"type":"string"},"logo":{"type":["string","null"]}},"required":["id","name","logo"]},"status":{"type":"string","enum":["pending","active","expiring","expired","invalidated","revoked"]},"consent":{"type":["object","null"],"properties":{"id":{"type":"string"},"status":{"type":"string"},"expires_at":{"type":["string","null"],"format":"date-time","example":"2026-08-21T09:30:00.000Z"}},"required":["id","status","expires_at"]},"accounts":{"type":["array","null"],"items":{"$ref":"#/components/schemas/AccountItem"},"description":"include[]=accounts"},"account_count":{"type":"integer"},"last_refreshed_at":{"type":["string","null"],"format":"date-time","example":"2026-08-21T09:30:00.000Z"},"ready_at":{"type":["string","null"],"format":"date-time","example":"2026-08-21T09:30:00.000Z"},"metadata":{"type":["object","null"],"additionalProperties":{"type":"string","maxLength":500},"description":"Up to 50 string pairs. Set a key to null in an update to unset it."},"livemode":{"type":"boolean"},"created":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"},"updated":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"}},"required":["id","object","provider","category","institution","status","consent","accounts","account_count","last_refreshed_at","ready_at","metadata","livemode","created","updated"]},"AccountItem":{"type":"object","properties":{"id":{"type":"string","example":"acct_9Lk2Mn4pQr6sTu8vWx1yZb"},"object":{"type":"string","enum":["account_item"]},"connection":{"type":"string"},"provider":{"type":"string"},"category":{"type":"string","enum":["banking","brokerage"]},"name":{"type":"string"},"type":{"type":"string"},"institution":{"type":"object","properties":{"id":{"type":"string","example":"inst_fk_anz"},"name":{"type":"string"},"logo":{"type":["string","null"]}},"required":["id","name","logo"]},"account_number":{"type":["string","null"],"description":"Masked, last four digits only"},"currency":{"type":"string"},"status":{"type":"string","enum":["available","syncing","unavailable"],"description":"`available`: readable. `syncing`: discovered, first transactions still arriving. `unavailable`: the provider stopped returning the account (closed, or removed from the consent); it stays listed so you can show it, but its transactions, balance and details return `404 account_unavailable`, and bulk balances return it with `freshness: unavailable`. It becomes `available` again if the provider returns it."},"last_updated_at":{"type":["string","null"],"format":"date-time","example":"2026-08-21T09:30:00.000Z"},"livemode":{"type":"boolean"},"created":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"},"updated":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"}},"required":["id","object","connection","provider","category","name","type","institution","account_number","currency","status","last_updated_at","livemode","created","updated"]},"ConsentList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Consent"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"Consent":{"type":"object","properties":{"id":{"type":"string","example":"cons_7Hq2Kp9dLm3nRt5vWx8yZa"},"object":{"type":"string","enum":["consent"]},"connection":{"type":["string","null"]},"status":{"type":"string","enum":["active","expiring","expired","withdrawn"]},"purpose":{"type":"string"},"data_types":{"type":"array","items":{"type":"string"}},"expires_at":{"type":["string","null"],"format":"date-time","example":"2026-08-21T09:30:00.000Z"},"withdrawn_at":{"type":["string","null"],"format":"date-time","example":"2026-08-21T09:30:00.000Z"},"termination_reason":{"type":["string","null"]},"livemode":{"type":"boolean"},"created":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"},"updated":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"}},"required":["id","object","connection","status","purpose","data_types","expires_at","withdrawn_at","termination_reason","livemode","created","updated"]},"AccountItemList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/AccountItem"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"Balance":{"type":"object","properties":{"object":{"type":"string","enum":["balance"]},"account":{"type":"string"},"current":{"$ref":"#/components/schemas/Money"},"available":{"$ref":"#/components/schemas/Money"},"currency":{"type":["string","null"]},"observed_at":{"type":["string","null"]},"freshness":{"type":["string","null"],"enum":["fresh","stale","stored","unavailable",null],"description":"`fresh`: a live read from the bank in the last 4 hours, as of `observed_at`. `stale`: Redbark's last live read, under 24 hours old, as of `observed_at`. `stored`: the provider's stored copy, of unknown age, so `observed_at` is null. `unavailable`: no balance could be read."},"retry_after_seconds":{"type":"integer","description":"Present on an unavailable balance that Redbark is holding back for now: seconds until a live read is worth retrying. Set when the account is inside the live refresh limit, was not reached before the request ran out of time, or its connection is in a cooldown, deferred, or temporarily unreachable."},"livemode":{"type":"boolean"}},"required":["object","account","current","available","currency","observed_at","freshness","livemode"]},"Money":{"type":["object","null"],"properties":{"amount":{"type":"integer"},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","currency"]},"AccountDetails":{"type":"object","properties":{"object":{"type":"string","enum":["account_details"]},"account":{"type":"string"},"product_name":{"type":["string","null"]},"deposit_rate":{"type":["string","null"]},"deposit_rates":{"type":"array","items":{"type":"object","additionalProperties":{}}},"lending_rate":{"type":["string","null"]},"lending_rates":{"type":"array","items":{"type":"object","additionalProperties":{}}},"fees":{"type":"array","items":{"type":"object","additionalProperties":{}}},"features":{"type":"array","items":{"type":"object","additionalProperties":{}}},"loan_details":{"type":["object","null"],"additionalProperties":{}},"livemode":{"type":"boolean"}},"required":["object","account","product_name","deposit_rate","deposit_rates","lending_rate","lending_rates","fees","features","loan_details","livemode"]},"BalanceList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Balance"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"TransactionList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"Transaction":{"type":"object","properties":{"id":{"type":"string","example":"txn_fk_8f1c2a3b-..."},"object":{"type":"string","enum":["transaction"]},"account":{"type":"string"},"status":{"type":"string"},"date":{"type":"string","description":"Local date YYYY-MM-DD"},"datetime":{"type":["string","null"]},"post_date":{"type":["string","null"]},"post_datetime":{"type":["string","null"]},"value_date":{"type":["string","null"]},"value_datetime":{"type":["string","null"]},"description":{"type":"string"},"reference":{"type":["string","null"],"description":"Provider-supplied payment reference, or null when unavailable"},"extended_description":{"type":["string","null"],"description":"Additional provider-supplied transaction description, or null when unavailable"},"payer":{"type":["string","null"],"description":"Name of the party that sent the payment, as the bank reports it, or null when unavailable"},"payee":{"type":["string","null"],"description":"Name of the party that received the payment, as the bank reports it, or null when unavailable"},"amount":{"$ref":"#/components/schemas/Money"},"direction":{"type":"string"},"provider_category":{"type":["string","null"]},"category":{"type":["string","null"],"description":"The user category (cat_) this transaction resolves to"},"merchant_name":{"type":["string","null"]},"merchant_category_code":{"type":["string","null"]},"livemode":{"type":"boolean"}},"required":["id","object","account","status","date","datetime","post_date","post_datetime","value_date","value_datetime","description","reference","extended_description","payer","payee","amount","direction","provider_category","category","merchant_name","merchant_category_code","livemode"]},"HoldingList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Holding"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"Holding":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["holding"]},"account":{"type":"string"},"instrument_id":{"type":["string","null"],"description":"Id of the underlying instrument, shared by every position in it (e.g. staked and unstaked balances of the same asset)"},"symbol":{"type":"string"},"name":{"type":["string","null"]},"exchange":{"type":["string","null"]},"currency":{"type":"string"},"quantity":{"type":"string"},"average_price":{"$ref":"#/components/schemas/Money"},"current_price":{"$ref":"#/components/schemas/Money"},"market_value":{"$ref":"#/components/schemas/Money"},"unrealized_pnl":{"$ref":"#/components/schemas/Money"},"positions":{"type":"array","items":{"$ref":"#/components/schemas/HoldingPosition"},"description":"The individual rows the broker reported for this instrument, ordered by quantity descending. One entry when the broker reported a single row; more than one when it reported several for the same instrument (e.g. staked and unstaked balances), which the fields above aggregate."},"livemode":{"type":"boolean"}},"required":["id","object","account","instrument_id","symbol","name","exchange","currency","quantity","average_price","current_price","market_value","unrealized_pnl","positions","livemode"]},"HoldingPosition":{"type":"object","properties":{"quantity":{"type":"string"},"average_price":{"$ref":"#/components/schemas/Money"},"current_price":{"$ref":"#/components/schemas/Money"},"market_value":{"$ref":"#/components/schemas/Money"},"unrealized_pnl":{"$ref":"#/components/schemas/Money"}},"required":["quantity","average_price","current_price","market_value","unrealized_pnl"]},"TradeList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Trade"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"Trade":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["trade"]},"account":{"type":"string"},"symbol":{"type":"string"},"name":{"type":["string","null"]},"type":{"type":"string"},"quantity":{"type":"string"},"price":{"$ref":"#/components/schemas/Money"},"currency":{"type":"string"},"total_amount":{"$ref":"#/components/schemas/Money"},"fees":{"$ref":"#/components/schemas/Money"},"trade_date":{"type":"string"},"settlement_date":{"type":["string","null"]},"description":{"type":["string","null"]},"livemode":{"type":"boolean"}},"required":["id","object","account","symbol","name","type","quantity","price","currency","total_amount","fees","trade_date","settlement_date","description","livemode"]},"ProviderCategoryList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ProviderCategory"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"ProviderCategory":{"type":"object","properties":{"object":{"type":"string","enum":["provider_category"]},"key":{"type":"string"},"label":{"type":"string"},"parent":{"type":["string","null"]},"provider":{"type":"string"}},"required":["object","key","label","parent","provider"]},"SyncList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Sync"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"Sync":{"type":"object","properties":{"id":{"type":"string","example":"sync_8Pq2Rs4tUv6wXy8zAb1cDe"},"object":{"type":"string","enum":["sync"]},"name":{"type":["string","null"]},"type":{"anyOf":[{"type":"string","enum":["transactions","accounts","holdings","trades"]},{"type":"string"}]},"enabled":{"type":"boolean"},"status":{"type":"string","enum":["idle","running","waiting","attention"]},"attention":{"type":["object","null"],"properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"destination":{"type":["object","null"],"properties":{"id":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"mapping_mode":{"type":"string","enum":["bulk","per_account"]}},"required":["id","type","name","mapping_mode"]},"accounts":{"type":"array","items":{"type":"string"}},"account_mappings":{"type":"array","items":{"type":"object","properties":{"account":{"type":"string"},"resource":{"type":"string","description":"Destination resource id (sheet tab id, YNAB account id, ...)"},"resource_name":{"type":["string","null"]}},"required":["account","resource","resource_name"]}},"options":{"type":"object","properties":{"data_from":{"type":["string","null"]},"include_pending":{"type":"boolean"},"mask_account_numbers":{"type":"boolean"},"custom_categories":{"type":"boolean"},"include_balances_tab":{"type":"boolean"}},"required":["data_from","include_pending","mask_account_numbers","custom_categories","include_balances_tab"]},"rulesets":{"type":"array","items":{"type":"string"}},"latest_run":{"$ref":"#/components/schemas/SyncRun"},"last_synced_at":{"type":["string","null"],"format":"date-time","example":"2026-08-21T09:30:00.000Z"},"metadata":{"type":["object","null"],"additionalProperties":{"type":"string","maxLength":500},"description":"Up to 50 string pairs. Set a key to null in an update to unset it."},"livemode":{"type":"boolean"},"created":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"},"updated":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"}},"required":["id","object","name","type","enabled","status","attention","destination","accounts","account_mappings","options","rulesets","latest_run","last_synced_at","metadata","livemode","created","updated"]},"SyncRun":{"type":["object","null"],"properties":{"id":{"type":"string","example":"run_4Kt7Lm2nPq9rSv1wXy3zAb"},"object":{"type":"string","enum":["sync_run"]},"sync":{"type":"string"},"destination":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","failed","cancelled"]},"trigger":{"type":"string","enum":["schedule","api","dashboard","webhook","resync"]},"counts":{"type":"object","properties":{"processed":{"type":["integer","null"]},"added":{"type":["integer","null"]},"updated":{"type":["integer","null"]},"rejected":{"type":["integer","null"]},"skipped_by_rules":{"type":["integer","null"]}},"required":["processed","added","updated","rejected","skipped_by_rules"]},"failure":{"type":["object","null"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"}},"required":["code","message","retryable"]},"started_at":{"type":["string","null"],"format":"date-time","example":"2026-08-21T09:30:00.000Z"},"completed_at":{"type":["string","null"],"format":"date-time","example":"2026-08-21T09:30:00.000Z"},"duration_ms":{"type":["integer","null"]},"livemode":{"type":"boolean"},"created":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"}},"required":["id","object","sync","destination","status","trigger","counts","failure","started_at","completed_at","duration_ms","livemode","created"],"description":"include[]=latest_run"},"CreateSync":{"type":"object","properties":{"type":{"type":"string","enum":["transactions","accounts","holdings","trades"],"description":"Default transactions"},"name":{"type":["string","null"],"maxLength":80},"destination":{"type":"string","example":"dest_3Fg5Hj7kLm9nPq1rSt3uVw"},"accounts":{"type":"array","items":{"type":"string"},"minItems":1},"mapping_mode":{"type":"string","enum":["bulk","per_account"],"description":"Sheets only: per_account writes each account to its own tab (created for you when account_mappings is omitted)"},"account_mappings":{"type":"array","items":{"type":"object","properties":{"account":{"type":"string"},"resource":{"type":"string","minLength":1},"resource_name":{"type":["string","null"]}},"required":["account","resource"]},"description":"Required for YNAB (budget account per bank account); optional for Sheets per_account"},"category_mappings":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","minLength":1},"destination_category":{"type":"string","minLength":1},"destination_category_name":{"type":["string","null"]}},"required":["source","destination_category"]}},"rulesets":{"type":"array","items":{"type":"string"},"maxItems":1},"options":{"type":"object","properties":{"data_from":{"type":"string","description":"YYYY-MM-DD; default 6 months (3 on trial), floor 84 months"},"include_pending":{"type":"boolean"},"mask_account_numbers":{"type":"boolean"},"custom_categories":{"type":"boolean"},"include_balances_tab":{"type":"boolean"}}},"run_now":{"type":"boolean","description":"Queue the first run immediately (default true)"},"metadata":{"type":"object","additionalProperties":{"type":["string","null"],"maxLength":500},"description":"Up to 50 string pairs. Set a key to null to unset it."}},"required":["destination","accounts"]},"UpdateSync":{"type":"object","properties":{"name":{"type":["string","null"],"maxLength":80},"enabled":{"type":"boolean"},"accounts":{"type":"array","items":{"type":"string"},"minItems":1},"account_mappings":{"type":"array","items":{"type":"object","properties":{"account":{"type":"string"},"resource":{"type":"string","minLength":1},"resource_name":{"type":["string","null"]}},"required":["account","resource"]}},"options":{"type":"object","properties":{"data_from":{"type":"string"},"include_pending":{"type":"boolean"},"mask_account_numbers":{"type":"boolean"},"custom_categories":{"type":"boolean"},"include_balances_tab":{"type":"boolean"}}},"metadata":{"type":"object","additionalProperties":{"type":["string","null"],"maxLength":500},"description":"Up to 50 string pairs. Set a key to null to unset it."}}},"Confirm":{"type":"object","properties":{"confirm":{"type":"boolean","enum":[true]}},"required":["confirm"]},"SyncRunList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/SyncRun"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"CategoryMappingList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","description":"Provider category code"},"destination_category":{"type":"string"},"destination_category_name":{"type":["string","null"]}},"required":["source","destination_category","destination_category_name"]}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"SetCategoryMappings":{"type":"object","properties":{"mappings":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","minLength":1},"destination_category":{"type":"string","minLength":1},"destination_category_name":{"type":["string","null"]}},"required":["source","destination_category"]}}},"required":["mappings"]},"CategoryList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"Category":{"type":"object","properties":{"id":{"type":"string","example":"cat_8Mn3Pq5rSt7uVw9xYz1aBc"},"object":{"type":"string","enum":["category"]},"name":{"type":"string"},"parent":{"type":["string","null"],"description":"null for a group"},"icon":{"type":["string","null"]},"color":{"type":["string","null"]},"position":{"type":"integer"},"archived":{"type":"boolean"},"sources":{"type":"array","items":{"type":"string"},"description":"Provider category codes this category claims"},"category_count":{"type":"integer","description":"Children, for a group"},"metadata":{"type":["object","null"],"additionalProperties":{"type":"string","maxLength":500},"description":"Up to 50 string pairs. Set a key to null in an update to unset it."},"livemode":{"type":"boolean"},"created":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"},"updated":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"}},"required":["id","object","name","parent","icon","color","position","archived","sources","category_count","metadata","livemode","created","updated"]},"CreateCategory":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"parent":{"type":["string","null"],"description":"Group id; omit to create a group"},"icon":{"type":["string","null"],"maxLength":16},"color":{"type":["string","null"],"maxLength":32},"metadata":{"type":"object","additionalProperties":{"type":["string","null"],"maxLength":500},"description":"Up to 50 string pairs. Set a key to null to unset it."}},"required":["name"]},"UpdateCategory":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"parent":{"type":"string"},"icon":{"type":["string","null"],"maxLength":16},"color":{"type":["string","null"],"maxLength":32},"position":{"type":"integer","minimum":0},"archived":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":{"type":["string","null"],"maxLength":500},"description":"Up to 50 string pairs. Set a key to null to unset it."}}},"ClaimResult":{"type":"object","properties":{"category":{"$ref":"#/components/schemas/Category"},"released_from":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"sources":{"type":"array","items":{"type":"string"}}},"required":["category","sources"]}}},"required":["category","released_from"]},"SetCategorySources":{"type":"object","properties":{"sources":{"type":"array","items":{"type":"string","minLength":1},"maxItems":200}},"required":["sources"]},"EventDestinationList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/EventDestination"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"EventDestination":{"type":"object","properties":{"id":{"type":"string","example":"ed_5Rt7Uv9wXy1zAb3cDe5fGh"},"object":{"type":"string","enum":["event_destination"]},"name":{"type":"string"},"type":{"type":"string","enum":["webhook_endpoint"]},"webhook_endpoint":{"type":"object","properties":{"url":{"type":"string"},"signing_secret":{"type":["string","null"],"description":"Set on create and rotate responses, null elsewhere"}},"required":["url","signing_secret"]},"enabled_events":{"type":"array","items":{"type":"string"}},"event_payload":{"type":"string","enum":["thin","snapshot"]},"status":{"type":"string","enum":["enabled","disabled"]},"status_details":{"type":["object","null"],"additionalProperties":{}},"metadata":{"type":["object","null"],"additionalProperties":{"type":"string","maxLength":500},"description":"Up to 50 string pairs. Set a key to null in an update to unset it."},"livemode":{"type":"boolean"},"created":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"},"updated":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"}},"required":["id","object","name","type","webhook_endpoint","enabled_events","event_payload","status","status_details","metadata","livemode","created","updated"]},"CreateEventDestination":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","enum":["webhook_endpoint"]},"webhook_endpoint":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]},"enabled_events":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"description":"Event types, families like \"sync_run.*\", or \"*\""},"event_payload":{"type":"string","enum":["thin","snapshot"]},"metadata":{"type":"object","additionalProperties":{"type":["string","null"],"maxLength":500},"description":"Up to 50 string pairs. Set a key to null to unset it."}},"required":["name","webhook_endpoint","enabled_events"]},"UpdateEventDestination":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"webhook_endpoint":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]},"enabled_events":{"type":"array","items":{"type":"string","minLength":1},"minItems":1},"metadata":{"type":"object","additionalProperties":{"type":["string","null"],"maxLength":500},"description":"Up to 50 string pairs. Set a key to null to unset it."}}},"Event":{"type":"object","properties":{"id":{"type":"string","example":"evt_2Hj4Kl6mNp8qRs0tUv2wXy"},"object":{"type":"string","enum":["event"]},"type":{"type":"string"},"created":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"},"livemode":{"type":"boolean"},"reason":{"type":"object","properties":{"type":{"type":"string","enum":["request","schedule","provider","system"]},"request":{"type":["object","null"],"properties":{"id":{"type":"string"},"idempotency_key":{"type":["string","null"]}},"required":["id","idempotency_key"]}},"required":["type","request"]},"related_object":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"url":{"type":"string"}},"required":["id","type","url"]},"data":{"type":["object","null"],"additionalProperties":{}},"changes":{"type":["object","null"],"additionalProperties":{}},"deliveries":{"type":["array","null"],"items":{"type":"object","properties":{"id":{"type":"string"},"event_destination":{"type":"string"},"status":{"type":"string","enum":["pending","succeeded","failed","abandoned"]},"attempts":{"type":"integer"},"next_attempt_at":{"type":["string","null"],"format":"date-time","example":"2026-08-21T09:30:00.000Z"},"last_attempt_at":{"type":["string","null"],"format":"date-time","example":"2026-08-21T09:30:00.000Z"},"last_status_code":{"type":["integer","null"]},"last_error":{"type":["string","null"]}},"required":["id","event_destination","status","attempts","next_attempt_at","last_attempt_at","last_status_code","last_error"]},"description":"Only on GET /v2/events/{id}"}},"required":["id","object","type","created","livemode","reason","related_object","data","changes","deliveries"]},"EventList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"LinkSession":{"type":"object","properties":{"id":{"type":"string","example":"ls_7Kp3Lm5nQr7sTu9vWx1yZa"},"object":{"type":"string","enum":["link_session"]},"provider":{"type":"string","enum":["fiskil","akahu","snaptrade","plaid"]},"institution":{"type":["string","null"]},"status":{"type":"string","enum":["pending","completed","expired","failed"]},"url":{"type":["string","null"],"description":"Hosted page to send the user to while pending"},"connection":{"type":["string","null"]},"start_token":{"type":["string","null"],"description":"Returned once, in the creating response, and only to Redbark's own apps; null everywhere else. Send it as the `X-Redbark-Link-Start` request header when opening `url`."},"return_url":{"type":["string","null"]},"failure_reason":{"type":["string","null"]},"expires_at":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"},"completed_at":{"type":["string","null"],"format":"date-time","example":"2026-08-21T09:30:00.000Z"},"metadata":{"type":["object","null"],"additionalProperties":{"type":"string","maxLength":500},"description":"Up to 50 string pairs. Set a key to null in an update to unset it."},"livemode":{"type":"boolean"},"created":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"},"updated":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"}},"required":["id","object","provider","institution","status","url","connection","start_token","return_url","failure_reason","expires_at","completed_at","metadata","livemode","created","updated"]},"CreateLinkSession":{"type":"object","properties":{"provider":{"type":"string","enum":["fiskil","akahu","snaptrade","plaid"]},"institution":{"type":["string","null"],"maxLength":100,"description":"Institution id from `GET /v2/institutions` for the same provider, to preselect. Not accepted for plaid: the user picks the bank in Plaid Link."},"return_url":{"type":["string","null"],"format":"uri"},"metadata":{"type":"object","additionalProperties":{"type":["string","null"],"maxLength":500},"description":"Up to 50 string pairs. Set a key to null to unset it."}},"required":["provider"]},"Reauthorize":{"type":"object","properties":{"return_url":{"type":["string","null"],"format":"uri"}}},"InstitutionList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Institution"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"Institution":{"type":"object","properties":{"id":{"type":"string","example":"inst_fk_anz"},"object":{"type":"string","enum":["institution"]},"provider":{"type":"string"},"name":{"type":"string"},"short_name":{"type":["string","null"]},"logo":{"type":["string","null"]},"available":{"type":"boolean"},"status":{"type":["string","null"],"description":"Provider-reported connection status. Null when the provider reports none (Akahu, Plaid, SnapTrade)."},"country":{"type":["string","null"],"description":"ISO 3166-1 alpha-2 country code; null for brokerages","example":"AU"},"type":{"type":"string","enum":["bank","brokerage"]},"popular":{"type":"boolean"},"popular_rank":{"type":["integer","null"],"description":"Position in the popular list, 1 first; null when not popular"}},"required":["id","object","provider","name","short_name","logo","available","status","country","type","popular","popular_rank"]},"DestinationLink":{"type":"object","properties":{"id":{"type":"string","example":"dl_3Hj5Kl7mNp9qRs1tUv3wXy"},"object":{"type":"string","enum":["destination_link"]},"type":{"type":"string","enum":["sheets","notion","airtable","ynab"]},"status":{"type":"string","enum":["pending","completed","expired","failed"]},"url":{"type":["string","null"]},"destination":{"type":["string","null"]},"return_url":{"type":["string","null"]},"failure_reason":{"type":["string","null"]},"expires_at":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"},"completed_at":{"type":["string","null"],"format":"date-time","example":"2026-08-21T09:30:00.000Z"},"metadata":{"type":["object","null"],"additionalProperties":{"type":"string","maxLength":500},"description":"Up to 50 string pairs. Set a key to null in an update to unset it."},"livemode":{"type":"boolean"},"created":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"},"updated":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"}},"required":["id","object","type","status","url","destination","return_url","failure_reason","expires_at","completed_at","metadata","livemode","created","updated"]},"CreateDestinationLink":{"type":"object","properties":{"type":{"type":"string","enum":["sheets","notion","airtable","ynab"]},"return_url":{"type":["string","null"],"format":"uri"},"metadata":{"type":"object","additionalProperties":{"type":["string","null"],"maxLength":500},"description":"Up to 50 string pairs. Set a key to null to unset it."}},"required":["type"]},"DestinationList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Destination"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"Destination":{"type":"object","properties":{"id":{"type":"string","example":"dest_3Fg5Hj7kLm9nPq1rSt3uVw"},"object":{"type":"string","enum":["destination"]},"type":{"anyOf":[{"type":"string","enum":["sheets","airtable","notion","ynab","webhook"]},{"type":"string"}]},"name":{"type":"string"},"status":{"type":"string","enum":["active","incomplete","reauth_required","disabled"]},"target":{"type":["object","null"],"additionalProperties":{},"description":"Type-specific target: spreadsheet_id/sheet_id, database_id, base_id/table_id, budget_id, url"},"config":{"type":["object","null"],"properties":{"signing_secret":{"type":["string","null"]}},"required":["signing_secret"],"description":"Webhook only; signing_secret is set on create and rotate responses, null elsewhere"},"sync_count":{"type":"integer"},"metadata":{"type":["object","null"],"additionalProperties":{"type":"string","maxLength":500},"description":"Up to 50 string pairs. Set a key to null in an update to unset it."},"livemode":{"type":"boolean"},"created":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"},"updated":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"}},"required":["id","object","type","name","status","target","config","sync_count","metadata","livemode","created","updated"]},"CreateDestination":{"type":"object","properties":{"type":{"type":"string","enum":["webhook"],"description":"Only webhook destinations are created directly; OAuth types go through POST /v2/destination_links"},"name":{"type":"string","minLength":1,"maxLength":100},"target":{"type":"object","properties":{"url":{"type":"string","format":"uri"}},"required":["url"]},"metadata":{"type":"object","additionalProperties":{"type":["string","null"],"maxLength":500},"description":"Up to 50 string pairs. Set a key to null to unset it."}},"required":["type","name","target"]},"UpdateDestination":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"target":{"type":"object","additionalProperties":{}},"metadata":{"type":"object","additionalProperties":{"type":["string","null"],"maxLength":500},"description":"Up to 50 string pairs. Set a key to null to unset it."}}},"DestinationResourceList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/DestinationResource"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"DestinationResource":{"type":"object","properties":{"object":{"type":"string","enum":["destination_resource"]},"type":{"type":"string","description":"spreadsheet | sheet | database | base | table | budget | account | category"},"id":{"type":"string"},"name":{"type":"string"},"parent":{"type":["string","null"]},"extra":{"type":["object","null"],"additionalProperties":{}}},"required":["object","type","id","name","parent","extra"]},"RulesetList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Ruleset"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"Ruleset":{"type":"object","properties":{"id":{"type":"string","example":"rset_6Kp8Lm1nQr3sTu5vWx7yZa"},"object":{"type":"string","enum":["ruleset"]},"name":{"type":"string"},"enabled":{"type":"boolean"},"rule_count":{"type":"integer"},"syncs":{"type":"array","items":{"type":"string"}},"metadata":{"type":["object","null"],"additionalProperties":{"type":"string","maxLength":500},"description":"Up to 50 string pairs. Set a key to null in an update to unset it."},"livemode":{"type":"boolean"},"created":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"},"updated":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"}},"required":["id","object","name","enabled","rule_count","syncs","metadata","livemode","created","updated"]},"CreateRuleset":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"enabled":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":{"type":["string","null"],"maxLength":500},"description":"Up to 50 string pairs. Set a key to null to unset it."}},"required":["name"]},"UpdateRuleset":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"enabled":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":{"type":["string","null"],"maxLength":500},"description":"Up to 50 string pairs. Set a key to null to unset it."}}},"RuleList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Rule"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"Rule":{"type":"object","properties":{"id":{"type":"string","example":"rule_2Ab4Cd6eFg8hJk0lMn2oPq"},"object":{"type":"string","enum":["rule"]},"ruleset":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer"},"enabled":{"type":"boolean"},"conditions":{"type":"object","additionalProperties":{},"description":"Groups of conditions (OR across groups, AND within). See the rules guide."},"action":{"type":"object","additionalProperties":{},"description":"{ type: \"skip\" | \"email\" | \"set_category\" | \"set_category_group\" | \"clear_category\" | \"set_merchant\" | \"set_description\" | \"set_note\" | \"add_tag\", value? }"},"metadata":{"type":["object","null"],"additionalProperties":{"type":"string","maxLength":500},"description":"Up to 50 string pairs. Set a key to null in an update to unset it."},"livemode":{"type":"boolean"},"created":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"},"updated":{"type":"string","format":"date-time","example":"2026-08-21T09:30:00.000Z"}},"required":["id","object","ruleset","name","position","enabled","conditions","action","metadata","livemode","created","updated"]},"CreateRule":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"conditions":{"type":"object","properties":{"groups":{"type":"array","items":{"type":"object","properties":{"conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["merchantName","description","amount","signedAmount","direction","category","subcategory","customCategoryGroup","class","accountId","accountName","reference","merchantCategoryCode","currency","dayOfMonth","dayOfWeek"]},"operator":{"type":"string","enum":["contains","does_not_contain","equals","starts_with","ends_with","matches_glob","does_not_match_glob","is_empty","is_not_empty","gt","lt","eq","between","is","is_not","is_in","is_not_in"]},"value":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":20}]}},"required":["field","operator"]},"minItems":1,"maxItems":10}},"required":["conditions"]},"minItems":1,"maxItems":10}},"required":["groups"]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_category"]},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_category_group"]},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","enum":["clear_category"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_merchant"]},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_description"]},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_note"]},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","enum":["add_tag"]},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["type","value"]}]},"enabled":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":{"type":["string","null"],"maxLength":500},"description":"Up to 50 string pairs. Set a key to null to unset it."}},"required":["name","conditions","action"]},"ReorderRules":{"type":"object","properties":{"rules":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":50}},"required":["rules"]},"RulePreviewList":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/RulePreviewRow"}},"next_page_url":{"type":["string","null"]},"previous_page_url":{"type":["string","null"]}},"required":["object","data","next_page_url","previous_page_url"]},"RulePreviewRow":{"type":"object","properties":{"transaction":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string"},"description":{"type":"string"},"amount":{"type":["object","null"],"properties":{"amount":{"type":"integer"},"currency":{"type":"string"}},"required":["amount","currency"]},"merchant_name":{"type":["string","null"]},"provider_category":{"type":["string","null"]}},"required":["id","date","description","amount","merchant_name","provider_category"]},"actions":{"type":"array","items":{"type":"object","properties":{"rule":{"type":"string"},"rule_name":{"type":"string"},"action":{"type":"object","additionalProperties":{}}},"required":["rule","rule_name","action"]}},"skipped":{"type":"boolean"}},"required":["transaction","actions","skipped"]},"RulePreview":{"type":"object","properties":{"account":{"type":"string"},"limit":{"type":"integer","minimum":1,"maximum":200},"from":{"type":"string"},"to":{"type":"string"}},"required":["account"]},"UpdateRule":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"conditions":{"type":"object","properties":{"groups":{"type":"array","items":{"type":"object","properties":{"conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["merchantName","description","amount","signedAmount","direction","category","subcategory","customCategoryGroup","class","accountId","accountName","reference","merchantCategoryCode","currency","dayOfMonth","dayOfWeek"]},"operator":{"type":"string","enum":["contains","does_not_contain","equals","starts_with","ends_with","matches_glob","does_not_match_glob","is_empty","is_not_empty","gt","lt","eq","between","is","is_not","is_in","is_not_in"]},"value":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"array","items":{"type":"string","minLength":1,"maxLength":200},"minItems":1,"maxItems":20}]}},"required":["field","operator"]},"minItems":1,"maxItems":10}},"required":["conditions"]},"minItems":1,"maxItems":10}},"required":["groups"]},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["skip"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_category"]},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_category_group"]},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","enum":["clear_category"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_merchant"]},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_description"]},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","enum":["set_note"]},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","enum":["add_tag"]},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["type","value"]}]},"enabled":{"type":"boolean"},"metadata":{"type":"object","additionalProperties":{"type":["string","null"],"maxLength":500},"description":"Up to 50 string pairs. Set a key to null to unset it."}}},"SetSyncRulesets":{"type":"object","properties":{"rulesets":{"type":"array","items":{"type":"string"},"maxItems":1}},"required":["rulesets"]}},"parameters":{}},"paths":{"/me":{"get":{"tags":["Account"],"summary":"Retrieve the account","operationId":"get_me","description":"The account behind the credential: who it belongs to, plan, entitlements, usage, plan fit, billing details and timezone. `email`, `name`, `first_name` and `last_name` are returned when the credential holds `account:read` (OAuth `mcp:read` includes it) and are null otherwise. API key calls also include the key and its scopes; OAuth calls return key as null. The Redbark app can read this endpoint when its plan does not include the app, so it can show its plan screen.","x-redbark-scope":"none","x-redbark-tier":"cheap","responses":{"200":{"description":"The account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api_keys":{"get":{"tags":["API keys"],"summary":"List API keys","operationId":"list_api_keys","description":"Every API key on the account, most recently created first. Secrets are never included; a secret is only ever returned once, on creation or rotation.","x-redbark-scope":"keys:write","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set."},"required":false,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected."},"required":false,"description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected.","name":"page","in":"query"}],"responses":{"200":{"description":"Keys, newest first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["API keys"],"summary":"Create an API key","operationId":"create_api_key","description":"Creates a restricted key. Scopes are required and must be a subset of the calling key's scopes. The secret is returned once, in this response only.","x-redbark-scope":"keys:write","x-redbark-tier":"mutating","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKey"}}}},"responses":{"201":{"description":"The created key, with its secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api_keys/{id}":{"get":{"tags":["API keys"],"summary":"Retrieve an API key","operationId":"get_api_key","description":"Retrieves one API key by id. The secret is never included; it is shown only once, on creation or rotation.","x-redbark-scope":"keys:write","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"key_3K1nTq8cZ5yWvR2mPd7Lx9"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"The key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["API keys"],"summary":"Update an API key","operationId":"update_api_key","description":"Rename or change metadata. Scopes are immutable after creation; rotate or create a new key instead.","x-redbark-scope":"keys:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"key_3K1nTq8cZ5yWvR2mPd7Lx9"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateApiKey"}}}},"responses":{"200":{"description":"The updated key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["API keys"],"summary":"Revoke an API key","operationId":"revoke_api_key","description":"Revokes the key immediately; it stops authenticating right away. Revoking an already-revoked key is a no-op.","x-redbark-scope":"keys:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"key_3K1nTq8cZ5yWvR2mPd7Lx9"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["api_key"]},"deleted":{"type":"boolean","enum":[true]}},"required":["id","object","deleted"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api_keys/{id}/rotate":{"post":{"tags":["API keys"],"summary":"Rotate an API key","operationId":"rotate_api_key","description":"Mints a replacement with the same name, scopes, allowlist and expiry and returns its secret once. The old key keeps working until the grace period ends (max 7 days). Optional JSON body `{ \"grace\": \"7d\" }`.","x-redbark-scope":"keys:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"key_3K1nTq8cZ5yWvR2mPd7Lx9"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"201":{"description":"The replacement key, with its secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/connections":{"get":{"tags":["Connections"],"summary":"List connections","operationId":"list_connections","description":"Bank and brokerage connections on the account, newest first. Filter by `status` (repeat with `status[]=` for several) or `provider`.","x-redbark-scope":"connections:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set."},"required":false,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected."},"required":false,"description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected.","name":"page","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Related objects to expand inline. Repeat the parameter for more than one; see each resource for its includes."},"required":false,"description":"Related objects to expand inline. Repeat the parameter for more than one; see each resource for its includes.","name":"include[]","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Filter by computed status; repeat with status[]= for several"},"required":false,"description":"Filter by computed status; repeat with status[]= for several","name":"status","in":"query"},{"schema":{"type":"string","description":"Filter by provider: fiskil, akahu, plaid, snaptrade or documents"},"required":false,"description":"Filter by provider: fiskil, akahu, plaid, snaptrade or documents","name":"provider","in":"query"}],"responses":{"200":{"description":"Connections, newest first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/connections/{id}":{"get":{"tags":["Connections"],"summary":"Retrieve a connection","operationId":"get_connection","description":"Retrieves one connection by id, with its computed status. Pass `include[]=accounts` to embed its accounts.","x-redbark-scope":"connections:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"conn_2Bc4De6fGh8jKl0mNp3qRs"},"required":true,"description":"The id of the object.","name":"id","in":"path"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Related objects to expand inline. Repeat the parameter for more than one; see each resource for its includes."},"required":false,"description":"Related objects to expand inline. Repeat the parameter for more than one; see each resource for its includes.","name":"include[]","in":"query"}],"responses":{"200":{"description":"The connection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connection"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Connections"],"summary":"Revoke a connection","operationId":"revoke_connection","description":"Withdraws consent at the provider, disables dependent syncs, and queues the data deletion. Fiskil revokes the consent, SnapTrade deregisters the brokerage authorisation, and Akahu revokes the authorisation for this one bank only; other New Zealand banks on the same Akahu account keep working. A Documents bucket cannot be revoked this way and returns `409 connection_not_revocable`. Emits `connection.revoked`.","x-redbark-scope":"connections:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"conn_2Bc4De6fGh8jKl0mNp3qRs"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["connection"]},"deleted":{"type":"boolean","enum":[true]}},"required":["id","object","deleted"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/consents":{"get":{"tags":["Consents"],"summary":"List consents","operationId":"list_consents","description":"CDR consent arrangements (and their brokerage and NZ equivalents), newest first.","x-redbark-scope":"connections:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set."},"required":false,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected."},"required":false,"description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected.","name":"page","in":"query"},{"schema":{"type":"string","description":"Filter to consents on this connection"},"required":false,"description":"Filter to consents on this connection","name":"connection","in":"query"}],"responses":{"200":{"description":"Consents","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/consents/{id}":{"get":{"tags":["Consents"],"summary":"Retrieve a consent","operationId":"get_consent","description":"Retrieves one consent arrangement by id.","x-redbark-scope":"connections:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"cons_7Hq2Kp9dLm3nRt5vWx8yZa"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"The consent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Consent"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/accounts":{"get":{"tags":["Accounts"],"summary":"List accounts","operationId":"list_accounts","description":"Accounts across every connection, newest first. Filter to one connection with `connection`.","x-redbark-scope":"data:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set."},"required":false,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected."},"required":false,"description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected.","name":"page","in":"query"},{"schema":{"type":"string","description":"Filter to accounts on this connection"},"required":false,"description":"Filter to accounts on this connection","name":"connection","in":"query"}],"responses":{"200":{"description":"Accounts, newest first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountItemList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/accounts/{id}":{"get":{"tags":["Accounts"],"summary":"Retrieve an account","operationId":"get_account","description":"Retrieves one account by id: its identity, type and currency. Balances and details are separate endpoints.","x-redbark-scope":"data:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"acct_9Lk2Mn4pQr6sTu8vWx1yZb"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"The account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountItem"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/accounts/{account}/balance":{"get":{"tags":["Accounts"],"summary":"Retrieve the account balance","operationId":"get_account_balance","description":"Banking accounts only. Pass the `account` field with an acct_ id whose `category` from list_accounts is `banking`; use list_holdings for brokerage accounts. May be served from the provider-specific connection gateway cache. When Redbark caching is disabled, Fiskil live refreshes are limited to once per account every 15 minutes; earlier requests return `429 balance_refresh_limited` with `Retry-After`. Never written to Redbark database or logs. Live bank reads are limited for callers acting while the customer is away (API keys, syncs, third-party apps) and never made for MCP: those balances come from the last live read Redbark made (`stale`, with its `observed_at`) or the stored copy the provider holds (`stored`, `observed_at` null).","x-redbark-scope":"data:read","x-redbark-tier":"mid","parameters":[{"schema":{"type":"string","pattern":"^acct_[0-9A-Za-z]{1,22}$","description":"A banking acct_ id returned by list_accounts. Brokerage accounts do not have balances or banking details.","example":"acct_9Lk2Mn4pQr6sTu8vWx1yZb"},"required":true,"description":"A banking acct_ id returned by list_accounts. Brokerage accounts do not have balances or banking details.","name":"account","in":"path"}],"responses":{"200":{"description":"The balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Balance"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"424":{"description":"Provider or destination failed definitively","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Provider unavailable; retry after Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/accounts/{account}/details":{"get":{"tags":["Accounts"],"summary":"Retrieve account details","operationId":"get_account_details","description":"Available for Australian bank accounts (Fiskil) only: other banking providers (Plaid, Akahu) return `not_supported`, and documents and brokerage accounts return `wrong_endpoint_for_category`. Product name, rates, fees, features and loan details as the bank reports them. Pass the `account` field with an acct_ id returned by list_accounts.","x-redbark-scope":"data:read","x-redbark-tier":"mid","parameters":[{"schema":{"type":"string","pattern":"^acct_[0-9A-Za-z]{1,22}$","description":"A banking acct_ id returned by list_accounts. Brokerage accounts do not have balances or banking details.","example":"acct_9Lk2Mn4pQr6sTu8vWx1yZb"},"required":true,"description":"A banking acct_ id returned by list_accounts. Brokerage accounts do not have balances or banking details.","name":"account","in":"path"}],"responses":{"200":{"description":"The details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDetails"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"424":{"description":"Provider or destination failed definitively","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Provider unavailable; retry after Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/balances":{"get":{"tags":["Accounts"],"summary":"List balances","operationId":"list_balances","description":"The bulk form of get_account_balance: pass one or more `account` query parameters (banking acct_ ids from list_accounts) and get every balance back in one call, in the order requested. Each item carries its own freshness, so a stale or unavailable read on one account never blocks the rest: an account whose provider is deferred, timed out or unreachable comes back with null amounts, `freshness: unavailable` and, when a retry can help, `retry_after_seconds`, while the others return normally. An account whose `status` is `unavailable` (removed by the provider) comes back unavailable without `retry_after_seconds`. The call fails only when no provider answered. When Redbark caching is disabled, Fiskil live refreshes are limited to once per account every 15 minutes: an account inside that limit comes back unavailable with `retry_after_seconds`. May be served from the provider-specific connection gateway cache. Never written to Redbark database or logs. Live bank reads are limited for callers acting while the customer is away (API keys, syncs, third-party apps) and never made for MCP: those balances come from the last live read Redbark made (`stale`, with its `observed_at`) or the stored copy the provider holds (`stored`, `observed_at` null).","x-redbark-scope":"data:read","x-redbark-tier":"mid","parameters":[{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Required. A banking acct_ id returned by list_accounts. Repeat the parameter for up to 100 accounts in one call; duplicates are collapsed.","example":"acct_9Lk2Mn4pQr6sTu8vWx1yZb"},"required":true,"description":"Required. A banking acct_ id returned by list_accounts. Repeat the parameter for up to 100 accounts in one call; duplicates are collapsed.","name":"account","in":"query"}],"responses":{"200":{"description":"The balances, in the order requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BalanceList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"424":{"description":"Provider or destination failed definitively","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Provider unavailable; retry after Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/transactions":{"get":{"tags":["Transactions"],"summary":"List transactions","operationId":"list_transactions","description":"Reads exactly one banking or Documents account, newest first. First call: pass `account` (not accountId or connectionId), optional `from`/`to`, and limit at most 100. Later pages: pass the opaque `page` token instead of offset. `from` must not be after `to`; banking history is limited to about 7 years. Omitting `from` restricts results to the last 30 days; pass it explicitly for older history, including imported Documents rows. Amounts are integer minor units in the currency of each transaction (`amount.currency`), which can differ from the account currency; no FX conversion is applied. `category` is the user category the transaction resolves to. Transactions include provider-supplied `reference`, `extended_description`, `payer` and `payee`, each null when unavailable. When the 5,000 row ceiling is hit the response carries `X-Redbark-Truncated: true` and a non-null next_page_url.","x-redbark-scope":"data:read","x-redbark-tier":"heavy","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set."},"required":false,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected."},"required":false,"description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected.","name":"page","in":"query"},{"schema":{"type":"string","pattern":"^acct_[0-9A-Za-z]{1,22}$","description":"Exactly one banking or Documents acct_ id returned by list_accounts. Required unless page is set. Do not pass a connection id, accountId, connectionId, accounts, or offset."},"required":false,"description":"Exactly one banking or Documents acct_ id returned by list_accounts. Required unless page is set. Do not pass a connection id, accountId, connectionId, accounts, or offset.","name":"account","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2}))?$","description":"YYYY-MM-DD or RFC 3339 with timezone; inclusive and must be on or before `to`. Defaults to 30 days ago. For banking accounts, do not request more than 7 years; Documents imports have no history floor. A bare YYYY-MM-DD is a calendar date in the user timezone (the same timezone used to render the returned `date` field); an RFC 3339 value is an instant."},"required":false,"description":"YYYY-MM-DD or RFC 3339 with timezone; inclusive and must be on or before `to`. Defaults to 30 days ago. For banking accounts, do not request more than 7 years; Documents imports have no history floor. A bare YYYY-MM-DD is a calendar date in the user timezone (the same timezone used to render the returned `date` field); an RFC 3339 value is an instant.","name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2}))?$","description":"YYYY-MM-DD or RFC 3339 with timezone; inclusive and must be on or after `from`. A bare YYYY-MM-DD is a calendar date in the user timezone (the same timezone used to render the returned `date` field); an RFC 3339 value is an instant."},"required":false,"description":"YYYY-MM-DD or RFC 3339 with timezone; inclusive and must be on or after `from`. A bare YYYY-MM-DD is a calendar date in the user timezone (the same timezone used to render the returned `date` field); an RFC 3339 value is an instant.","name":"to","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Include pending (not yet settled) transactions; default false"},"required":false,"description":"Include pending (not yet settled) transactions; default false","name":"include_pending","in":"query"}],"responses":{"200":{"description":"Transactions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"424":{"description":"Provider or destination failed definitively","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Provider unavailable; retry after Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/transactions/{id}":{"get":{"tags":["Transactions"],"summary":"Retrieve a transaction","operationId":"get_transaction","description":"Looks the transaction up by provider id within the given account and date window (defaults to the last 30 days). Requires `account`. Includes pending transactions and provider-supplied `reference`, `extended_description`, `payer` and `payee`, each null when unavailable. The amount is integer minor units in the currency of the transaction (`amount.currency`), which can differ from the account currency; no FX conversion is applied. Searches at most 5,000 provider rows within a bounded page budget. If the search cannot confirm absence within that budget, returns 400 transaction_search_incomplete: narrow the from/to date range and retry. Returns 404 only when the valid window is exhausted without a match, or the transaction/account scope is invalid; when the window was searched, the 404 message names it. An id taken from a wider search can fall outside the default 30 days: pass `from` and `to` covering the transaction date.","x-redbark-scope":"data:read","x-redbark-tier":"heavy","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"txn_fk_…"},"required":true,"description":"The id of the object.","name":"id","in":"path"},{"schema":{"type":"string","description":"Required. The acct_ id to read."},"required":true,"description":"Required. The acct_ id to read.","name":"account","in":"query"},{"schema":{"type":"string","description":"YYYY-MM-DD or RFC 3339; inclusive. A bare YYYY-MM-DD is a calendar date in the user timezone (matching the returned `date` field); an RFC 3339 value is an instant."},"required":false,"description":"YYYY-MM-DD or RFC 3339; inclusive. A bare YYYY-MM-DD is a calendar date in the user timezone (matching the returned `date` field); an RFC 3339 value is an instant.","name":"from","in":"query"},{"schema":{"type":"string","description":"YYYY-MM-DD or RFC 3339; inclusive. A bare YYYY-MM-DD is a calendar date in the user timezone (matching the returned `date` field); an RFC 3339 value is an instant."},"required":false,"description":"YYYY-MM-DD or RFC 3339; inclusive. A bare YYYY-MM-DD is a calendar date in the user timezone (matching the returned `date` field); an RFC 3339 value is an instant.","name":"to","in":"query"}],"responses":{"200":{"description":"The transaction","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transaction"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"424":{"description":"Provider or destination failed definitively","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Provider unavailable; retry after Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/holdings":{"get":{"tags":["Holdings"],"summary":"List holdings","operationId":"list_holdings","description":"Live positions for one brokerage account.","x-redbark-scope":"data:read","x-redbark-tier":"heavy","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set."},"required":false,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected."},"required":false,"description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected.","name":"page","in":"query"},{"schema":{"type":"string","description":"Required. The acct_ id to read."},"required":true,"description":"Required. The acct_ id to read.","name":"account","in":"query"}],"responses":{"200":{"description":"Holdings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HoldingList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"424":{"description":"Provider or destination failed definitively","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Provider unavailable; retry after Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/trades":{"get":{"tags":["Trades"],"summary":"List trades","operationId":"list_trades","description":"Executed trades for one brokerage account, newest first.","x-redbark-scope":"data:read","x-redbark-tier":"heavy","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set."},"required":false,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected."},"required":false,"description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected.","name":"page","in":"query"},{"schema":{"type":"string","description":"Required. The acct_ id to read."},"required":true,"description":"Required. The acct_ id to read.","name":"account","in":"query"},{"schema":{"type":"string","description":"YYYY-MM-DD or RFC 3339; inclusive"},"required":false,"description":"YYYY-MM-DD or RFC 3339; inclusive","name":"from","in":"query"},{"schema":{"type":"string","description":"YYYY-MM-DD or RFC 3339; inclusive"},"required":false,"description":"YYYY-MM-DD or RFC 3339; inclusive","name":"to","in":"query"}],"responses":{"200":{"description":"Trades","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TradeList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"424":{"description":"Provider or destination failed definitively","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Provider unavailable; retry after Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/provider_categories":{"get":{"tags":["Categories"],"summary":"List provider categories","operationId":"list_provider_categories","description":"The fixed category vocabulary banks and enrichment assign to transactions (what v1 served at /categories). Subcategories carry their parent. Not paginated.","x-redbark-scope":"data:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"string","description":"Provider whose vocabulary to label the results with; default cdr"},"required":false,"description":"Provider whose vocabulary to label the results with; default cdr","name":"provider","in":"query"}],"responses":{"200":{"description":"Provider categories","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderCategoryList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/syncs":{"get":{"tags":["Syncs"],"summary":"List syncs","operationId":"list_syncs","description":"Syncs on the account, newest first. Filter by `status` (repeat with `status[]=` for several), `enabled` or `destination`; pass `include[]=latest_run` to embed each sync's most recent run.","x-redbark-scope":"syncs:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set."},"required":false,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected."},"required":false,"description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected.","name":"page","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Related objects to expand inline. Repeat the parameter for more than one; see each resource for its includes."},"required":false,"description":"Related objects to expand inline. Repeat the parameter for more than one; see each resource for its includes.","name":"include[]","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Filter by computed status; repeat with status[]= for several"},"required":false,"description":"Filter by computed status; repeat with status[]= for several","name":"status","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Filter to enabled or disabled syncs"},"required":false,"description":"Filter to enabled or disabled syncs","name":"enabled","in":"query"},{"schema":{"type":"string","description":"Filter to syncs writing to this destination"},"required":false,"description":"Filter to syncs writing to this destination","name":"destination","in":"query"}],"responses":{"200":{"description":"Syncs, newest first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Syncs"],"summary":"Create a sync","operationId":"create_sync","description":"Creates a sync from accounts to a destination and queues its first run. The destination must be active (have a target); YNAB needs account_mappings; brokerage accounts need a Sheets destination. One sync per destination.","x-redbark-scope":"syncs:write","x-redbark-tier":"mutating","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSync"}}}},"responses":{"201":{"description":"The created sync (latest_run is the queued first run)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sync"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/syncs/{id}":{"get":{"tags":["Syncs"],"summary":"Retrieve a sync","operationId":"get_sync","description":"Retrieves one sync by id. Pass `include[]=latest_run` to embed its most recent run.","x-redbark-scope":"syncs:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"sync_8Pq2Rs4tUv6wXy8zAb1cDe"},"required":true,"description":"The id of the object.","name":"id","in":"path"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Related objects to expand inline. Repeat the parameter for more than one; see each resource for its includes."},"required":false,"description":"Related objects to expand inline. Repeat the parameter for more than one; see each resource for its includes.","name":"include[]","in":"query"}],"responses":{"200":{"description":"The sync","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sync"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Syncs"],"summary":"Update a sync","operationId":"update_sync","description":"Partial update: name, enabled, accounts, account mappings, options and metadata. Destination and type are fixed; create a new sync to change them.","x-redbark-scope":"syncs:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"sync_8Pq2Rs4tUv6wXy8zAb1cDe"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSync"}}}},"responses":{"200":{"description":"The updated sync","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sync"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Syncs"],"summary":"Update a sync (PATCH alias)","operationId":"patch_sync","description":"Partial update: name, enabled, accounts, account mappings, options and metadata. Destination and type are fixed; create a new sync to change them.","x-redbark-scope":"syncs:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"sync_8Pq2Rs4tUv6wXy8zAb1cDe"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSync"}}}},"responses":{"200":{"description":"The updated sync","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sync"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Syncs"],"summary":"Delete a sync","operationId":"delete_sync","description":"Removes the sync and its run history. Rulesets and destinations are left in place.","x-redbark-scope":"syncs:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"sync_8Pq2Rs4tUv6wXy8zAb1cDe"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["sync"]},"deleted":{"type":"boolean","enum":[true]}},"required":["id","object","deleted"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/syncs/{id}/run":{"post":{"tags":["Syncs"],"summary":"Run a sync now","operationId":"run_sync","description":"Queues a run, or joins the already scheduled logical job, and returns its latest run. Poll `GET /v2/sync_runs/{id}` or subscribe to `sync_run.*` events.","x-redbark-scope":"syncs:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"sync_8Pq2Rs4tUv6wXy8zAb1cDe"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"202":{"description":"The queued run","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncRun"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/syncs/{id}/resync":{"post":{"tags":["Syncs"],"summary":"Resync from the start date","operationId":"resync_sync","description":"Rewinds the sync so the next run re-reads from `options.data_from`, then queues that run. Requires `{ \"confirm\": true }`.","x-redbark-scope":"syncs:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"sync_8Pq2Rs4tUv6wXy8zAb1cDe"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Confirm"}}}},"responses":{"202":{"description":"The queued run","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncRun"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/syncs/{id}/runs":{"get":{"tags":["Sync runs"],"summary":"List runs for a sync","operationId":"list_sync_runs","description":"Runs from the last 90 days, newest first.","x-redbark-scope":"syncs:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"sync_8Pq2Rs4tUv6wXy8zAb1cDe"},"required":true,"description":"The id of the object.","name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set."},"required":false,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected."},"required":false,"description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected.","name":"page","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Filter by run status; repeat with status[]= for several"},"required":false,"description":"Filter by run status; repeat with status[]= for several","name":"status","in":"query"}],"responses":{"200":{"description":"Runs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncRunList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sync_runs/{id}":{"get":{"tags":["Sync runs"],"summary":"Retrieve a run","operationId":"get_sync_run","description":"Retrieves one sync run by id, with its status and any error.","x-redbark-scope":"syncs:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"run_4Kt7Lm2nPq9rSv1wXy3zAb"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"The run","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncRun"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/sync_runs/{id}/cancel":{"post":{"tags":["Sync runs"],"summary":"Cancel a queued run","operationId":"cancel_sync_run","description":"Only runs still `queued` can be cancelled; a run that has started returns 409 `run_not_cancellable`.","x-redbark-scope":"syncs:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"run_4Kt7Lm2nPq9rSv1wXy3zAb"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"The cancelled run","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncRun"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/syncs/{id}/category_mappings":{"get":{"tags":["Syncs"],"summary":"List category mappings","operationId":"list_sync_category_mappings","description":"How provider categories map onto destination categories for this sync (YNAB budget categories).","x-redbark-scope":"syncs:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"sync_8Pq2Rs4tUv6wXy8zAb1cDe"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"Mappings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryMappingList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Syncs"],"summary":"Replace category mappings","operationId":"set_sync_category_mappings","description":"Replaces the full set of provider-to-destination category mappings for this sync. The sync must have a destination; each source category can appear at most once.","x-redbark-scope":"syncs:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"sync_8Pq2Rs4tUv6wXy8zAb1cDe"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetCategoryMappings"}}}},"responses":{"200":{"description":"Mappings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryMappingList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/categories":{"get":{"tags":["Categories"],"summary":"List categories","operationId":"list_categories","description":"Your taxonomy: groups (parent null) and their categories, in display order. Seeds the default taxonomy on first use. Filters: `parent` (a group id, or `none` for groups only), `archived`.","x-redbark-scope":"categories:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set."},"required":false,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected."},"required":false,"description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected.","name":"page","in":"query"},{"schema":{"type":"string","description":"A group id to list its categories, or \"none\" to list groups only"},"required":false,"description":"A group id to list its categories, or \"none\" to list groups only","name":"parent","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Filter to archived or active entries"},"required":false,"description":"Filter to archived or active entries","name":"archived","in":"query"}],"responses":{"200":{"description":"Categories","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Categories"],"summary":"Create a group or category","operationId":"create_category","description":"Omit `parent` to create a group; pass a group id to create a category inside it.","x-redbark-scope":"categories:write","x-redbark-tier":"mutating","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCategory"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/categories/reset":{"post":{"tags":["Categories"],"summary":"Reset the taxonomy","operationId":"reset_categories","description":"Drops every group, category and source claim and reseeds the default template. Requires `{ \"confirm\": true }`.","x-redbark-scope":"categories:write","x-redbark-tier":"mutating","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Confirm"}}}},"responses":{"200":{"description":"The reseeded taxonomy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/categories/{id}":{"get":{"tags":["Categories"],"summary":"Retrieve a category","operationId":"get_category","description":"Retrieves one group or category by id.","x-redbark-scope":"categories:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"cat_8Mn3Pq5rSt7uVw9xYz1aBc"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"The category","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Categories"],"summary":"Update a category","operationId":"update_category","description":"Rename, recolour, reparent (categories only), reorder or archive.","x-redbark-scope":"categories:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"cat_8Mn3Pq5rSt7uVw9xYz1aBc"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCategory"}}}},"responses":{"200":{"description":"The updated category","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Categories"],"summary":"Update a category (PATCH alias)","operationId":"patch_category","description":"Rename, recolour, reparent (categories only), reorder or archive.","x-redbark-scope":"categories:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"cat_8Mn3Pq5rSt7uVw9xYz1aBc"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCategory"}}}},"responses":{"200":{"description":"The updated category","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Categories"],"summary":"Delete a group or category","operationId":"delete_category","description":"A group with categories returns 409 `category_has_children` unless `cascade=true`. Pass `reassign_to` to move this category's source claims onto another category; otherwise its sources fall back to the provider category.","x-redbark-scope":"categories:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"cat_8Mn3Pq5rSt7uVw9xYz1aBc"},"required":true,"description":"The id of the object.","name":"id","in":"path"},{"schema":{"type":"string","enum":["true","false"],"description":"Required to delete a group that still has categories"},"required":false,"description":"Required to delete a group that still has categories","name":"cascade","in":"query"},{"schema":{"type":"string","description":"Move this category's source claims onto another category id instead of releasing them"},"required":false,"description":"Move this category's source claims onto another category id instead of releasing them","name":"reassign_to","in":"query"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["category"]},"deleted":{"type":"boolean","enum":[true]}},"required":["id","object","deleted"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/categories/{id}/sources":{"post":{"tags":["Categories"],"summary":"Replace the claimed sources","operationId":"set_category_sources","description":"Sets which provider categories route to this category. A source belongs to one category, so claiming it moves it; the response lists where each moved source came from.","x-redbark-scope":"categories:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"cat_8Mn3Pq5rSt7uVw9xYz1aBc"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetCategorySources"}}}},"responses":{"200":{"description":"The category and what was released","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimResult"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/event_destinations":{"get":{"tags":["Event destinations"],"summary":"List event destinations","operationId":"list_event_destinations","description":"Webhook endpoints registered to receive events, newest first. Signing secrets are never included.","x-redbark-scope":"events:write","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set."},"required":false,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected."},"required":false,"description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected.","name":"page","in":"query"}],"responses":{"200":{"description":"Event destinations","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDestinationList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Event destinations"],"summary":"Create an event destination","operationId":"create_event_destination","description":"A webhook endpoint that receives signed thin events. The signing secret is returned in `webhook_endpoint.signing_secret` on create and rotate responses only (shown once); elsewhere it is null. Max 10 per account.","x-redbark-scope":"events:write","x-redbark-tier":"mutating","parameters":[{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Related objects to expand inline. Repeat the parameter for more than one; see each resource for its includes."},"required":false,"description":"Related objects to expand inline. Repeat the parameter for more than one; see each resource for its includes.","name":"include[]","in":"query"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEventDestination"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDestination"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/event_destinations/{id}":{"get":{"tags":["Event destinations"],"summary":"Retrieve an event destination","operationId":"get_event_destination","description":"Retrieves one event destination by id. The signing secret is never included.","x-redbark-scope":"events:write","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"ed_5Rt7Uv9wXy1zAb3cDe5fGh"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"The event destination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDestination"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Event destinations"],"summary":"Update an event destination","operationId":"update_event_destination","description":"Rename, change the webhook url, enabled events or metadata.","x-redbark-scope":"events:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"ed_5Rt7Uv9wXy1zAb3cDe5fGh"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEventDestination"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDestination"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Event destinations"],"summary":"Update an event destination (PATCH alias)","operationId":"patch_event_destination","description":"Same as POST /event_destinations/{id}.","x-hidden":true,"x-redbark-scope":"events:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"ed_5Rt7Uv9wXy1zAb3cDe5fGh"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateEventDestination"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDestination"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Event destinations"],"summary":"Delete an event destination","operationId":"delete_event_destination","description":"Removes the event destination; no further events are delivered to it.","x-redbark-scope":"events:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"ed_5Rt7Uv9wXy1zAb3cDe5fGh"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["event_destination"]},"deleted":{"type":"boolean","enum":[true]}},"required":["id","object","deleted"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/event_destinations/{id}/enable":{"post":{"tags":["Event destinations"],"summary":"Enable an event destination","operationId":"enable_event_destination","description":"Resumes deliveries and clears the consecutive-failure count.","x-redbark-scope":"events:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"ed_5Rt7Uv9wXy1zAb3cDe5fGh"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDestination"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/event_destinations/{id}/disable":{"post":{"tags":["Event destinations"],"summary":"Disable an event destination","operationId":"disable_event_destination","description":"Stops deliveries without deleting the destination; it can be re-enabled at any time.","x-redbark-scope":"events:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"ed_5Rt7Uv9wXy1zAb3cDe5fGh"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDestination"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/event_destinations/{id}/ping":{"post":{"tags":["Event destinations"],"summary":"Send a ping event","operationId":"ping_event_destination","description":"Emits `event_destination.ping` to this destination only and returns the event. A disabled destination is rejected with 409 `event_destination_disabled`; re-enable it first.","x-redbark-scope":"events:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"ed_5Rt7Uv9wXy1zAb3cDe5fGh"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"202":{"description":"The ping event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/event_destinations/{id}/rotate_secret":{"post":{"tags":["Event destinations"],"summary":"Rotate the signing secret","operationId":"rotate_event_destination_secret","description":"Issues a new secret and keeps the previous one valid for 24 hours; during the overlap every delivery carries one `v1=` per active secret. The new secret is returned in `webhook_endpoint.signing_secret`.","x-redbark-scope":"events:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"ed_5Rt7Uv9wXy1zAb3cDe5fGh"},"required":true,"description":"The id of the object.","name":"id","in":"path"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Related objects to expand inline. Repeat the parameter for more than one; see each resource for its includes."},"required":false,"description":"Related objects to expand inline. Repeat the parameter for more than one; see each resource for its includes.","name":"include[]","in":"query"}],"responses":{"200":{"description":"The destination with its new secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventDestination"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/events":{"get":{"tags":["Events"],"summary":"List events","operationId":"list_events","description":"The last 30 days of events for resources this key can read, newest first. Filter with `type[]=` (exact types, families like `sync_run.*`, or `*` for all readable types).","x-redbark-scope":"events:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set."},"required":false,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected."},"required":false,"description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected.","name":"page","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Filter by event type, a family like sync_run.*, or * for all readable types; repeat with type[]= for several"},"required":false,"description":"Filter by event type, a family like sync_run.*, or * for all readable types; repeat with type[]= for several","name":"type","in":"query"},{"schema":{"type":"string","description":"Filter to events about this object id (connection, sync, sync_run, destination, category, event_destination or account_item)"},"required":false,"description":"Filter to events about this object id (connection, sync, sync_run, destination, category, event_destination or account_item)","name":"related_object","in":"query"}],"responses":{"200":{"description":"Events","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/events/{id}":{"get":{"tags":["Events"],"summary":"Retrieve an event","operationId":"get_event","description":"The full event with `data`, `changes` and its delivery attempts.","x-redbark-scope":"events:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"evt_2Hj4Kl6mNp8qRs0tUv2wXy"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"The event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/events/{id}/redeliver":{"post":{"tags":["Events"],"summary":"Redeliver an event","operationId":"redeliver_event","description":"Queues a fresh delivery to every subscribed destination within the 30 day window. Optional JSON body `{ \"event_destination\": \"ed_…\" }` limits it to one destination.","x-redbark-scope":"events:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"evt_2Hj4Kl6mNp8qRs0tUv2wXy"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"202":{"description":"The event with the new deliveries","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Event"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/link_sessions":{"post":{"tags":["Link sessions"],"summary":"Create a link session","operationId":"create_link_session","description":"Mints a hosted consent flow. Send the user to `url`; they sign in to Redbark (same account as the key), complete the bank consent, and land on `return_url`. Poll `GET /v2/link_sessions/{id}` or subscribe to `connection.created`. Returns `403 subscription_required` when the account has no active trial or subscription, for every caller and for reauthorization too, `403 connection_limit` when the plan has no free connection slot (a reauthorization is exempt) and `403 professional_required` for a brokerage session on a plan without brokerage. The Redbark apps open the page with the one-time `start_token` sent as the `X-Redbark-Link-Start` header and return to their registered app link callback; API keys and third-party OAuth clients always sign in on the page and use an https `return_url`.","x-redbark-scope":"connections:write","x-redbark-tier":"mutating","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLinkSession"}}}},"responses":{"201":{"description":"The link session","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkSession"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/link_sessions/{id}":{"get":{"tags":["Link sessions"],"summary":"Retrieve a link session","operationId":"get_link_session","description":"Retrieves one link session by id, including its status and the connection it produced once completed.","x-redbark-scope":"connections:write","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"ls_7Kp3Lm5nQr7sTu9vWx1yZa"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"The link session","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkSession"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/connections/{id}/reauthorize":{"post":{"tags":["Connections"],"summary":"Reauthorize a connection","operationId":"reauthorize_connection","description":"Returns a link session bound to this connection. Completing it renews the existing connection in place: the connection keeps its id and its accounts, no new connection is created, and exactly one `connection.refreshed` event is emitted. Fiskil amends the same consent and resets its period, SnapTrade reconnects the same brokerage authorization, Akahu restores the same bank, and Plaid reopens Plaid Link in update mode on the same Item. A reauthorization takes no connection slot. Returns `404 resource_missing` when the connection no longer exists (for example once an expired consent has been deleted), in which case start a new link session instead, and `403 subscription_required` when the account has no active trial or subscription.","x-redbark-scope":"connections:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"conn_2Bc4De6fGh8jKl0mNp3qRs"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reauthorize"}}}},"responses":{"201":{"description":"The link session","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkSession"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/connections/{id}/refresh":{"post":{"tags":["Connections"],"summary":"Refresh a connection","operationId":"refresh_connection","description":"Queues account discovery for the connection when it is active, so accounts the bank added or changed are picked up, and a run for every enabled sync that reads this connection (skipping any already running). Returns the queued sync runs; account discovery runs in the background and returns no run.","x-redbark-scope":"connections:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"conn_2Bc4De6fGh8jKl0mNp3qRs"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"202":{"description":"Queued runs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncRunList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/institutions":{"get":{"tags":["Institutions"],"summary":"List institutions","operationId":"list_institutions","description":"Banks and brokerages you can connect, across Fiskil (Australia), Akahu (New Zealand), Plaid (United States) and SnapTrade (brokerages). Filter by `provider`, `country`, `type` or `popular`, and search with `q`. Popular lists are sorted by `popular_rank`; everything else is sorted by name. Fiskil institutions report current availability. Akahu, Plaid and SnapTrade institutions have no availability feed, so they are listed as available with a null `status`. Plaid institutions are search-only: they are listed only when `q` has at least 2 characters, and without it `provider=plaid` or `country=US` returns an empty list. A provider whose directory cannot be loaded contributes no rows. Pass an institution `id` as `institution` when creating a link session for the same provider.","x-redbark-scope":"connections:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set."},"required":false,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected."},"required":false,"description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected.","name":"page","in":"query"},{"schema":{"type":"string","description":"fiskil, akahu, plaid or snaptrade. Without provider, country or type, only fiskil is returned"},"required":false,"description":"fiskil, akahu, plaid or snaptrade. Without provider, country or type, only fiskil is returned","name":"provider","in":"query"},{"schema":{"type":"string","minLength":2,"maxLength":2,"description":"ISO 3166-1 alpha-2 country code, for example AU, NZ or US. Brokerages have no country and never match."},"required":false,"description":"ISO 3166-1 alpha-2 country code, for example AU, NZ or US. Brokerages have no country and never match.","name":"country","in":"query"},{"schema":{"type":"string","enum":["bank","brokerage"],"description":"Filter by institution type"},"required":false,"description":"Filter by institution type","name":"type","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"true lists only popular institutions, sorted by popular_rank; false lists the rest"},"required":false,"description":"true lists only popular institutions, sorted by popular_rank; false lists the rest","name":"popular","in":"query"},{"schema":{"type":"string","maxLength":100,"description":"Search by institution name. Required, with at least 2 characters, to list Plaid institutions"},"required":false,"description":"Search by institution name. Required, with at least 2 characters, to list Plaid institutions","name":"q","in":"query"}],"responses":{"200":{"description":"Institutions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstitutionList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/destination_links":{"post":{"tags":["Destination links"],"summary":"Create a destination link","operationId":"create_destination_link","description":"Hosted OAuth for Sheets, Notion, Airtable or YNAB. On completion a draft destination is created; set its target with `POST /v2/destinations/{id}` (list options at `GET /v2/destinations/{id}/resources`).","x-redbark-scope":"destinations:write","x-redbark-tier":"mutating","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDestinationLink"}}}},"responses":{"201":{"description":"The destination link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DestinationLink"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/destination_links/{id}":{"get":{"tags":["Destination links"],"summary":"Retrieve a destination link","operationId":"get_destination_link","description":"Retrieves one destination link by id, including its status and the draft destination it produced once completed.","x-redbark-scope":"destinations:write","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"dl_3Hj5Kl7mNp9qRs1tUv3wXy"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"The destination link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DestinationLink"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/destinations":{"get":{"tags":["Destinations"],"summary":"List destinations","operationId":"list_destinations","description":"Destinations on the account, newest first. Filter by `type` (sheets, notion, airtable, ynab or webhook).","x-redbark-scope":"destinations:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set."},"required":false,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected."},"required":false,"description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected.","name":"page","in":"query"},{"schema":{"type":"string","description":"Filter by destination type: sheets, notion, airtable, ynab or webhook"},"required":false,"description":"Filter by destination type: sheets, notion, airtable, ynab or webhook","name":"type","in":"query"}],"responses":{"200":{"description":"Destinations, newest first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DestinationList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Destinations"],"summary":"Create a webhook destination","operationId":"create_destination","description":"Webhook destinations are created directly. Sheets, Notion, Airtable and YNAB go through `POST /v2/destination_links`. The signing secret is returned in `config.signing_secret` on create and rotate responses only (shown once); elsewhere it is null.","x-redbark-scope":"destinations:write","x-redbark-tier":"mutating","parameters":[{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Related objects to expand inline. Repeat the parameter for more than one; see each resource for its includes."},"required":false,"description":"Related objects to expand inline. Repeat the parameter for more than one; see each resource for its includes.","name":"include[]","in":"query"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDestination"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Destination"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/destinations/{id}":{"get":{"tags":["Destinations"],"summary":"Retrieve a destination","operationId":"get_destination","description":"Retrieves one destination by id, with its status and target.","x-redbark-scope":"destinations:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"dest_3Fg5Hj7kLm9nPq1rSt3uVw"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"The destination","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Destination"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Destinations"],"summary":"Update a destination","operationId":"update_destination","description":"Rename, change the target (spreadsheet/sheet, database, base/table, budget, or webhook url) or metadata. Setting the target on a draft destination makes it active.","x-redbark-scope":"destinations:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"dest_3Fg5Hj7kLm9nPq1rSt3uVw"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDestination"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Destination"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Destinations"],"summary":"Update a destination (PATCH alias)","operationId":"patch_destination","description":"Rename, change the target (spreadsheet/sheet, database, base/table, budget, or webhook url) or metadata. Setting the target on a draft destination makes it active.","x-redbark-scope":"destinations:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"dest_3Fg5Hj7kLm9nPq1rSt3uVw"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDestination"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Destination"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Destinations"],"summary":"Delete a destination","operationId":"delete_destination","description":"Removes the destination; syncs that only wrote here are deleted too. 409 `destination_in_use` while a run is writing to it.","x-redbark-scope":"destinations:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"dest_3Fg5Hj7kLm9nPq1rSt3uVw"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["destination"]},"deleted":{"type":"boolean","enum":[true]}},"required":["id","object","deleted"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/destinations/{id}/rotate_secret":{"post":{"tags":["Destinations"],"summary":"Rotate a webhook signing secret","operationId":"rotate_destination_secret","description":"Webhook destinations only. Issues a new signing secret, returned in `config.signing_secret` on this response only.","x-redbark-scope":"destinations:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"dest_3Fg5Hj7kLm9nPq1rSt3uVw"},"required":true,"description":"The id of the object.","name":"id","in":"path"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Related objects to expand inline. Repeat the parameter for more than one; see each resource for its includes."},"required":false,"description":"Related objects to expand inline. Repeat the parameter for more than one; see each resource for its includes.","name":"include[]","in":"query"}],"responses":{"200":{"description":"The destination with its new secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Destination"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/destinations/{id}/enable":{"post":{"tags":["Destinations"],"summary":"Re-enable a disabled destination","operationId":"enable_destination","description":"Clears the consecutive-failure count and resumes writes to the destination.","x-redbark-scope":"destinations:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"dest_3Fg5Hj7kLm9nPq1rSt3uVw"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Destination"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/destinations/{id}/resources":{"get":{"tags":["Destinations"],"summary":"List what a destination offers","operationId":"list_destination_resources","description":"Spreadsheets and sheets (Sheets), databases (Notion), bases and tables (Airtable), budgets, accounts and categories (YNAB). `type` narrows; `parent` scopes to a spreadsheet, base or budget. Live from the provider.","x-redbark-scope":"destinations:read","x-redbark-tier":"mid","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"dest_3Fg5Hj7kLm9nPq1rSt3uVw"},"required":true,"description":"The id of the object.","name":"id","in":"path"},{"schema":{"type":"string","enum":["spreadsheet","sheet","database","base","table","budget","account","category"],"description":"Narrow to one resource type"},"required":false,"description":"Narrow to one resource type","name":"type","in":"query"},{"schema":{"type":"string","description":"Scope to a spreadsheet, base or budget id (required for sheet, table, account or category)"},"required":false,"description":"Scope to a spreadsheet, base or budget id (required for sheet, table, account or category)","name":"parent","in":"query"}],"responses":{"200":{"description":"Resources","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DestinationResourceList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"424":{"description":"Provider or destination failed definitively","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Provider unavailable; retry after Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/rulesets":{"get":{"tags":["Rules"],"summary":"List rulesets","operationId":"list_rulesets","description":"Rulesets on the account, newest first.","x-redbark-scope":"rules:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set."},"required":false,"description":"1 to 100, default 20. For more results follow next_page_url instead of raising limit. Ignored when page is set.","name":"limit","in":"query"},{"schema":{"type":"string","description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected."},"required":false,"description":"Opaque token from next_page_url / previous_page_url. Filters are locked to the first call of a walk; changing them while paging is rejected.","name":"page","in":"query"}],"responses":{"200":{"description":"Rulesets","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulesetList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Rules"],"summary":"Create a ruleset","operationId":"create_ruleset","description":"Creates an empty, enabled ruleset. Attach it to a sync with POST /v2/syncs/{id}/rulesets, then add rules.","x-redbark-scope":"rules:write","x-redbark-tier":"mutating","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRuleset"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ruleset"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/rulesets/{id}":{"get":{"tags":["Rules"],"summary":"Retrieve a ruleset","operationId":"get_ruleset","description":"Retrieves one ruleset by id, with its rule count and the syncs it is attached to.","x-redbark-scope":"rules:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"rset_6Kp8Lm1nQr3sTu5vWx7yZa"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"The ruleset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ruleset"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Rules"],"summary":"Update a ruleset","operationId":"update_ruleset","description":"Rename, enable/disable or change metadata.","x-redbark-scope":"rules:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"rset_6Kp8Lm1nQr3sTu5vWx7yZa"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRuleset"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ruleset"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Rules"],"summary":"Update a ruleset (PATCH alias)","operationId":"patch_ruleset","description":"Same as POST /rulesets/{id}.","x-hidden":true,"x-redbark-scope":"rules:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"rset_6Kp8Lm1nQr3sTu5vWx7yZa"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRuleset"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ruleset"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Rules"],"summary":"Delete a ruleset","operationId":"delete_ruleset","description":"Rules and sync attachments go with it.","x-redbark-scope":"rules:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"rset_6Kp8Lm1nQr3sTu5vWx7yZa"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["ruleset"]},"deleted":{"type":"boolean","enum":[true]}},"required":["id","object","deleted"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/rulesets/{id}/duplicate":{"post":{"tags":["Rules"],"summary":"Duplicate a ruleset","operationId":"duplicate_ruleset","description":"Optional JSON body `{ \"name\": \"…\" }`.","x-redbark-scope":"rules:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"rset_6Kp8Lm1nQr3sTu5vWx7yZa"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"201":{"description":"The copy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ruleset"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/rulesets/{id}/rules":{"get":{"tags":["Rules"],"summary":"List rules in a ruleset","operationId":"list_ruleset_rules","description":"The rules in this ruleset, in evaluation order (position). Rules run top to bottom; the first match wins.","x-redbark-scope":"rules:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"rset_6Kp8Lm1nQr3sTu5vWx7yZa"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"Rules in position order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Rules"],"summary":"Create a rule","operationId":"create_rule","description":"Up to 50 rules per ruleset; new rules go last.","x-redbark-scope":"rules:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"rset_6Kp8Lm1nQr3sTu5vWx7yZa"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRule"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rule"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/rulesets/{id}/rules/reorder":{"post":{"tags":["Rules"],"summary":"Reorder rules","operationId":"reorder_ruleset_rules","description":"Pass every rule id in the ruleset, in the desired order.","x-redbark-scope":"rules:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"rset_6Kp8Lm1nQr3sTu5vWx7yZa"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderRules"}}}},"responses":{"200":{"description":"Rules in the new order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/rulesets/{id}/preview":{"post":{"tags":["Rules"],"summary":"Preview a ruleset","operationId":"preview_ruleset","description":"Dry run: evaluates the ruleset against recent transactions of one account and returns what each rule would do. Nothing is written. Heavy tier.","x-redbark-scope":"rules:read","x-redbark-tier":"heavy","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"rset_6Kp8Lm1nQr3sTu5vWx7yZa"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulePreview"}}}},"responses":{"200":{"description":"Per-transaction outcomes","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulePreviewList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"424":{"description":"Provider or destination failed definitively","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Provider unavailable; retry after Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/rules/{id}":{"get":{"tags":["Rules"],"summary":"Retrieve a rule","operationId":"get_rule","description":"Retrieves one rule by id, with its conditions and action.","x-redbark-scope":"rules:read","x-redbark-tier":"cheap","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"rule_2Ab4Cd6eFg8hJk0lMn2oPq"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"The rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rule"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Rules"],"summary":"Update a rule","operationId":"update_rule","description":"Rename, change conditions, action, enabled state or metadata. Fields are replaced whole, not merged.","x-redbark-scope":"rules:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"rule_2Ab4Cd6eFg8hJk0lMn2oPq"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRule"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rule"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Rules"],"summary":"Update a rule (PATCH alias)","operationId":"patch_rule","description":"Same as POST /rules/{id}.","x-hidden":true,"x-redbark-scope":"rules:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"rule_2Ab4Cd6eFg8hJk0lMn2oPq"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRule"}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rule"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Rules"],"summary":"Delete a rule","operationId":"delete_rule","description":"Removes the rule from its ruleset; the remaining rules keep their order.","x-redbark-scope":"rules:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"rule_2Ab4Cd6eFg8hJk0lMn2oPq"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["rule"]},"deleted":{"type":"boolean","enum":[true]}},"required":["id","object","deleted"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/syncs/{id}/rulesets":{"post":{"tags":["Rules"],"summary":"Attach a ruleset to a sync","operationId":"attach_sync_ruleset","description":"A sync has at most one ruleset; pass `[]` to detach.","x-redbark-scope":"syncs:write","x-redbark-tier":"mutating","parameters":[{"schema":{"type":"string","description":"The id of the object.","example":"sync_8Pq2Rs4tUv6wXy8zAb1cDe"},"required":true,"description":"The id of the object.","name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetSyncRulesets"}}}},"responses":{"200":{"description":"Attached rulesets","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulesetList"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Key lacks a scope, plan lacks the feature, or IP not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"State conflict or Idempotency-Key conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited; see Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal error; quote request_id to support","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{}}