{"openapi":"3.1.0","info":{"title":"StatementIQ API","summary":"Bank-verified income & expense reports via the Consumer Data Right.","description":"The StatementIQ API turns a customer's consented bank data — shared through Australia's Consumer Data Right (CDR) — into decision-ready income, expense and affordability reports.\n\n**Base URL:** `https://api.statementiq.com.au`\n\n**Authentication.** Send your API key in the `X-API-Key` header. Every firm has two keys (Portal → Settings):\n\n- `siq_test_…` — sandbox: mock bank data, always available.\n- `siq_live_…` — production: real customer banks, active once your company is approved for production.\n\nThe key you use determines the request's environment; test and live data are fully isolated.\n\n**Typical flow.** Create a request → share the returned consent link with your customer (in production you can also have us email or SMS it) → the customer connects their bank → the report generates automatically and is delivered to you (poll or webhook).\n\nFull guides: https://docs.statementiq.com.au","contact":{"name":"StatementIQ","url":"https://statementiq.com.au/","email":"hello@statementiq.com.au"},"license":{"name":"Terms of Service","url":"https://statementiq.com.au/terms"},"version":"1.0"},"servers":[{"url":"https://api.statementiq.com.au","description":"Production"}],"paths":{"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/v1/requests":{"post":{"summary":"Create Request","operationId":"create_request_v1_requests_post","parameters":[{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"List Requests","operationId":"list_requests_v1_requests_get","parameters":[{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/requests/{rid}":{"get":{"summary":"Get Request","operationId":"get_request_v1_requests__rid__get","parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","title":"Rid"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Withdraw","operationId":"withdraw_v1_requests__rid__delete","parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","title":"Rid"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/connect/{rid}":{"get":{"summary":"Connect Info","description":"PUBLIC (no API key): resolves a client's consent link. The random request id IS\nthe bearer token. Returns only client-facing context + a freshly-minted, single-use\nCDR consent URL to hand off to (Fiskil hosted flow). No bank data is exposed here.","operationId":"connect_info_v1_connect__rid__get","parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","title":"Rid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/connect/{rid}/withdraw":{"post":{"summary":"Consumer Withdraw","description":"PUBLIC (no API key): CDR consumer-initiated withdrawal from their own connect link.\nDeletes derived data, removes the CDR end-user upstream, keeps the audit trail, and\nnotifies the firm by webhook. Idempotent.","operationId":"consumer_withdraw_v1_connect__rid__withdraw_post","parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","title":"Rid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/requests/{rid}/generate":{"post":{"summary":"Generate","operationId":"generate_v1_requests__rid__generate_post","parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","title":"Rid"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/requests/{rid}/consent-complete":{"post":{"summary":"Consent Complete","description":"Called by the consent return flow. Generates the report once the bank data is\navailable; returns pending_data if the CDR feed hasn't ingested yet (poll to retry).","operationId":"consent_complete_v1_requests__rid__consent_complete_post","parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","title":"Rid"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/webhooks/fiskil":{"post":{"summary":"Fiskil Webhook","description":"Fiskil consent/data event. Resolves the end_user_id to a request and generates\nthe report. Always ACKs (200) so Fiskil doesn't retry storms.","operationId":"fiskil_webhook_v1_webhooks_fiskil_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/requests/{rid}/report":{"get":{"summary":"Get Report","operationId":"get_report_v1_requests__rid__report_get","parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","title":"Rid"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/requests/{rid}/report.html":{"get":{"summary":"Get Report Html","operationId":"get_report_html_v1_requests__rid__report_html_get","parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","title":"Rid"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/requests/{rid}/report.xml":{"get":{"summary":"Get Report Xml","operationId":"get_report_xml_v1_requests__rid__report_xml_get","parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","title":"Rid"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/requests/{rid}/report.pdf":{"get":{"summary":"Get Report Pdf","operationId":"get_report_pdf_v1_requests__rid__report_pdf_get","parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","title":"Rid"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/requests/{rid}/invite":{"post":{"summary":"Invite","description":"Send the client their secure consent link by email or SMS, StatementIQ-branded\n'on behalf of {firm}'. The firm supplies the recipient address/number.\n\nProduction only: a sandbox request can copy/share its link, but cannot dispatch real\nemails or SMS. This stops unapproved firms messaging real people with test links and\navoids the per-message cost before a firm is approved for production.","operationId":"invite_v1_requests__rid__invite_post","parameters":[{"name":"rid","in":"path","required":true,"schema":{"type":"string","title":"Rid"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invite"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"CreateRequest":{"properties":{"client_name":{"type":"string","title":"Client Name"},"report_type":{"type":"string","enum":["expense_summary","affordability"],"title":"Report Type"},"client_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Ref"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"period_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Label"},"redirect_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Redirect Uri"},"cancel_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancel Uri"}},"type":"object","required":["client_name","report_type"],"title":"CreateRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Invite":{"properties":{"channel":{"type":"string","enum":["email","sms"],"title":"Channel"},"to":{"type":"string","title":"To"}},"type":"object","required":["channel","to"],"title":"Invite"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}