{"openapi":"3.0.3","info":{"title":"Broker Sync API","version":"1.0.0","description":"Normalized real positions, balances, and transactions across 30+ brokerages via SnapTrade — one schema regardless of broker, no CSV import. Plus a live-verified prop-firm integration registry.\n\n**Access — both work on every /v1 endpoint:**\n1. **API key** — `x-api-key` header, free, rate-limited.\n2. **x402 pay-per-call** — no signup: call with no key, get a `402` for $0.001/request on base USDC, pay via an x402 client, get `200` + data.","contact":{"url":"https://broker-sync-api.wickedapi.com"},"termsOfService":"https://broker-sync-api.wickedapi.com/"},"servers":[{"url":"https://broker-sync-api.wickedapi.com","description":"Production"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key","description":"Free, rate-limited access."}},"schemas":{"Envelope":{"type":"object","required":["data","meta"],"properties":{"data":{"type":"object","description":"Endpoint-specific payload."},"meta":{"type":"object","required":["timestamp"],"properties":{"timestamp":{"type":"string","format":"date-time"}},"additionalProperties":true}}},"Error":{"type":"object","properties":{"error":{"type":"string"},"source":{"type":"string"}}},"X402Challenge":{"type":"object","description":"x402 payment challenge — sign a USDC transferWithAuthorization and retry with an X-PAYMENT header.","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"accepts":{"type":"array","items":{"type":"object","properties":{"scheme":{"type":"string","example":"exact"},"network":{"type":"string","example":"base"},"maxAmountRequired":{"type":"string"},"resource":{"type":"string"},"description":{"type":"string"},"payTo":{"type":"string"},"asset":{"type":"string"},"maxTimeoutSeconds":{"type":"integer"}}}}}}},"responses":{"Unauthorized":{"description":"Missing or invalid x-api-key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"PaymentRequired":{"description":"No valid x-api-key — pay per call via x402 (USDC on Base).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/X402Challenge"}}}},"RateLimited":{"description":"Rate limit exceeded (keyed access)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"UpstreamError":{"description":"Upstream data error — never fabricated, a real source failure","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"tags":[{"name":"meta","description":"Health & service catalog"},{"name":"v1","description":"Protocol health data"}],"paths":{"/health":{"get":{"operationId":"get_health","summary":"Liveness check.","description":"Liveness check.","tags":["meta"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[]}},"/v1/status":{"get":{"operationId":"get_v1_status","summary":"Service catalog + SnapTrade configuration state.","description":"Service catalog + SnapTrade configuration state.","tags":["v1"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[]}},"/v1/users":{"post":{"operationId":"post_v1_users","summary":"Register a user with SnapTrade and get a brokerage connection-portal URL.","description":"Register a user with SnapTrade and get a brokerage connection-portal URL.","tags":["v1"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["user_id"],"properties":{"user_id":{"type":"string","description":"Your application's stable identifier for this end user."}}}}}},"security":[{"ApiKeyAuth":[]},{}],"x-402":{"scheme":"exact","network":"base","price":"$0.001","maxAmountRequired":"1000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x63EbccD826b874CE988e6498eAabB6Bd47AfC8A4"}}},"/v1/connections":{"get":{"operationId":"get_v1_connections","summary":"List a user's connected brokerage accounts (normalized).","description":"List a user's connected brokerage accounts (normalized).","tags":["v1"],"parameters":[{"name":"user_id","in":"query","required":true,"description":"Required.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"ApiKeyAuth":[]},{}],"x-402":{"scheme":"exact","network":"base","price":"$0.001","maxAmountRequired":"1000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x63EbccD826b874CE988e6498eAabB6Bd47AfC8A4"}}},"/v1/positions":{"get":{"operationId":"get_v1_positions","summary":"Real positions across all of a user's connected brokerages, one normalized schema, stamped as_of.","description":"Real positions across all of a user's connected brokerages, one normalized schema, stamped as_of.","tags":["v1"],"parameters":[{"name":"user_id","in":"query","required":true,"description":"Required.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"ApiKeyAuth":[]},{}],"x-402":{"scheme":"exact","network":"base","price":"$0.001","maxAmountRequired":"1000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x63EbccD826b874CE988e6498eAabB6Bd47AfC8A4"}}},"/v1/balances":{"get":{"operationId":"get_v1_balances","summary":"Cash & buying power per connected account (normalized).","description":"Cash & buying power per connected account (normalized).","tags":["v1"],"parameters":[{"name":"user_id","in":"query","required":true,"description":"Required.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"ApiKeyAuth":[]},{}],"x-402":{"scheme":"exact","network":"base","price":"$0.001","maxAmountRequired":"1000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x63EbccD826b874CE988e6498eAabB6Bd47AfC8A4"}}},"/v1/transactions":{"get":{"operationId":"get_v1_transactions","summary":"Transaction/activity history across brokerages.","description":"Transaction/activity history across brokerages.","tags":["v1"],"parameters":[{"name":"user_id","in":"query","required":true,"description":"Required.","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"description":"Optional. YYYY-MM-DD.","schema":{"type":"string"}},{"name":"to","in":"query","required":false,"description":"Optional. YYYY-MM-DD.","schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"ApiKeyAuth":[]},{}],"x-402":{"scheme":"exact","network":"base","price":"$0.001","maxAmountRequired":"1000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x63EbccD826b874CE988e6498eAabB6Bd47AfC8A4"}}},"/v1/prop-firms":{"get":{"operationId":"get_v1_prop_firms","summary":"Prop-firm platform integration registry — live-verified methods (Topstep ProjectX API, FTMO MatchTrader bridge) and connection status.","description":"Prop-firm platform integration registry — live-verified methods (Topstep ProjectX API, FTMO MatchTrader bridge) and connection status.","tags":["v1"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"429":{"$ref":"#/components/responses/RateLimited"},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[{"ApiKeyAuth":[]},{}],"x-402":{"scheme":"exact","network":"base","price":"$0.001","maxAmountRequired":"1000","asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","payTo":"0x63EbccD826b874CE988e6498eAabB6Bd47AfC8A4"}}},"/v1/webhooks/snaptrade":{"post":{"operationId":"post_v1_webhooks_snaptrade","summary":"SnapTrade webhook receiver (account/connection updates)","description":"SnapTrade webhook receiver (account/connection updates). Called by SnapTrade, not by API consumers.","tags":["v1"],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"502":{"$ref":"#/components/responses/UpstreamError"}},"security":[]}}}}