{"openapi":"3.1.0","info":{"title":"Redbark API","version":"1.0.0","description":"REST API for accessing bank accounts, transactions, and connections."},"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"API key authentication. Use: Authorization: Bearer YOUR_API_KEY"}},"schemas":{},"parameters":{}},"paths":{"/health":{"get":{"tags":["Health"],"responses":{"200":{"description":"Service is healthy","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]}}}}}}},"/v1/accounts":{"get":{"tags":["Accounts"],"security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"integer","minimum":1},"required":false,"name":"limit","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"List of accounts","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":128},"connectionId":{"type":"string","maxLength":128},"provider":{"type":"string","nullable":true,"maxLength":64},"name":{"type":"string","maxLength":256},"type":{"type":"string","maxLength":64},"institutionName":{"type":"string","nullable":true,"maxLength":256},"accountNumber":{"type":"string","nullable":true,"maxLength":64},"currency":{"type":"string","maxLength":8}},"required":["id","connectionId","provider","name","type","institutionName","accountNumber","currency"]}},"pagination":{"type":"object","properties":{"total":{"type":"number","nullable":true},"limit":{"type":"number"},"offset":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["total","limit","offset","hasMore"]}},"required":["data","pagination"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded — see `Retry-After` and `X-RateLimit-Reset` headers","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"503":{"description":"Upstream provider error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}}}}},"/v1/balances":{"get":{"tags":["Balances"],"security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":4000},"required":true,"name":"accountIds","in":"query"}],"responses":{"200":{"description":"Account balances","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"accountId":{"type":"string","maxLength":128},"currentBalance":{"type":"string","nullable":true},"availableBalance":{"type":"string","nullable":true},"currency":{"type":"string","nullable":true,"maxLength":8}},"required":["accountId","currentBalance","availableBalance","currency"]}}},"required":["data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded — see `Retry-After` and `X-RateLimit-Reset` headers","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"503":{"description":"Upstream provider error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}}}}},"/v1/categories":{"get":{"tags":["Categories"],"security":[{"Bearer":[]}],"responses":{"200":{"description":"List of transaction categories","content":{"application/json":{"schema":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"]}}},"required":["categories"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded — see `Retry-After` and `X-RateLimit-Reset` headers","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"503":{"description":"Upstream provider error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}}}}},"/v1/transactions":{"get":{"tags":["Transactions"],"security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"integer","minimum":1},"required":false,"name":"limit","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":true,"name":"connectionId","in":"query"},{"schema":{"type":"string","maxLength":128},"required":false,"name":"accountId","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"List of transactions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":128},"accountId":{"type":"string","maxLength":128},"accountName":{"type":"string","maxLength":256},"status":{"type":"string","maxLength":64},"date":{"type":"string","maxLength":32},"datetime":{"type":"string","nullable":true,"maxLength":64},"description":{"type":"string","maxLength":512},"amount":{"type":"string","maxLength":32},"direction":{"type":"string","maxLength":16},"category":{"type":"string","nullable":true,"maxLength":128},"merchantName":{"type":"string","nullable":true,"maxLength":256},"merchantCategoryCode":{"type":"string","nullable":true,"maxLength":16}},"required":["id","accountId","accountName","status","date","datetime","description","amount","direction","category","merchantName","merchantCategoryCode"]}},"pagination":{"type":"object","properties":{"total":{"type":"number","nullable":true},"limit":{"type":"number"},"offset":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["total","limit","offset","hasMore"]}},"required":["data","pagination"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded — see `Retry-After` and `X-RateLimit-Reset` headers","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"503":{"description":"Upstream provider error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}}}}},"/v1/connections":{"get":{"tags":["Connections"],"security":[{"Bearer":[]}],"responses":{"200":{"description":"List of connections","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":128},"provider":{"type":"string","maxLength":64},"category":{"type":"string","maxLength":64},"institutionId":{"type":"string","maxLength":128},"institutionName":{"type":"string","maxLength":256},"institutionLogo":{"type":"string","nullable":true,"maxLength":2048},"status":{"type":"string","maxLength":64},"lastRefreshedAt":{"type":"string","nullable":true,"maxLength":64},"createdAt":{"type":"string","maxLength":64}},"required":["id","provider","category","institutionId","institutionName","institutionLogo","status","lastRefreshedAt","createdAt"]}}},"required":["data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded — see `Retry-After` and `X-RateLimit-Reset` headers","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"503":{"description":"Upstream provider error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}}}}},"/v1/holdings":{"get":{"tags":["Holdings"],"security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":128},"required":true,"name":"connectionId","in":"query"},{"schema":{"type":"string","maxLength":128},"required":false,"name":"accountId","in":"query"},{"schema":{"type":"string","maxLength":4000},"required":false,"name":"accountIds","in":"query"}],"responses":{"200":{"description":"List of holdings","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":128},"accountId":{"type":"string","maxLength":128},"accountName":{"type":"string","maxLength":256},"symbol":{"type":"string","maxLength":32},"name":{"type":"string","nullable":true,"maxLength":256},"exchange":{"type":"string","nullable":true,"maxLength":64},"currency":{"type":"string","maxLength":8},"quantity":{"type":"string","maxLength":32},"averagePrice":{"type":"string","nullable":true,"maxLength":32},"currentPrice":{"type":"string","nullable":true,"maxLength":32},"marketValue":{"type":"string","nullable":true,"maxLength":32},"unrealizedPnl":{"type":"string","nullable":true,"maxLength":32}},"required":["id","accountId","accountName","symbol","name","exchange","currency","quantity","averagePrice","currentPrice","marketValue","unrealizedPnl"]}}},"required":["data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"403":{"description":"Professional plan required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded — see `Retry-After` and `X-RateLimit-Reset` headers","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"503":{"description":"Upstream provider error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}}}}},"/v1/trades":{"get":{"tags":["Trades"],"security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"integer","minimum":1},"required":false,"name":"limit","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":128},"required":true,"name":"connectionId","in":"query"},{"schema":{"type":"string","maxLength":128},"required":false,"name":"accountId","in":"query"},{"schema":{"type":"string","maxLength":4000},"required":false,"name":"accountIds","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"List of trades","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","maxLength":128},"accountId":{"type":"string","maxLength":128},"accountName":{"type":"string","maxLength":256},"symbol":{"type":"string","maxLength":32},"name":{"type":"string","nullable":true,"maxLength":256},"type":{"type":"string","maxLength":64},"quantity":{"type":"string","maxLength":32},"price":{"type":"string","maxLength":32},"currency":{"type":"string","maxLength":8},"totalAmount":{"type":"string","maxLength":32},"fees":{"type":"string","nullable":true,"maxLength":32},"tradeDate":{"type":"string","maxLength":64},"settlementDate":{"type":"string","nullable":true,"maxLength":64},"description":{"type":"string","nullable":true,"maxLength":512}},"required":["id","accountId","accountName","symbol","name","type","quantity","price","currency","totalAmount","fees","tradeDate","settlementDate","description"]}},"pagination":{"type":"object","properties":{"total":{"type":"number","nullable":true},"limit":{"type":"number"},"offset":{"type":"number"},"hasMore":{"type":"boolean"}},"required":["total","limit","offset","hasMore"]}},"required":["data","pagination"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"403":{"description":"Professional plan required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded — see `Retry-After` and `X-RateLimit-Reset` headers","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}},"503":{"description":"Upstream provider error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"string"}}},"required":["message"]}},"required":["error"]}}}}}}}}}