{"info":{"title":"Akahu Apply API","version":"1.0.0"},"servers":[{"url":"https://api.apply.akahu.nz","description":"Akahu Apply API"}],"openapi":"3.1.0","components":{"securitySchemes":{"APIKey":{"type":"http","scheme":"bearer","description":"Bearer auth using an Akahu Apply API Key. These can be generated by an Akahu Apply administrator in the web portal."}},"schemas":{"OrgId":{"type":"string","pattern":"^org_[a-z0-9]{24,27}$","example":"org_tz4a98xxat96iws9zmbrgj3a"},"Org":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/OrgId"},"name":{"type":"string"},"logo":{"type":"string","description":"A URL referencing the org's logo in PNG format."}},"required":["_id","name"]},"APIIssue":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"array","items":{"anyOf":[{"oneOf":[{"type":"string"},{"type":"integer"}]}]}}},"required":["code","message","path"]},"ApplicationId":{"type":"string","pattern":"^application_[a-z0-9]{24,27}$","example":"application_tz4a98xxat96iws9zmbrgj3a"},"ApplicationStatus":{"type":"string","enum":["active","archived"]},"Application":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/ApplicationId"},"reference":{"type":"string","maxLength":500,"description":"A value used to identify the application in a way that makes sense to the creator.\n\nFor some this may include the applicant names, for others it may be a unique reference from their CRM.\n\nIt does not need to be unique."},"status":{"$ref":"#/components/schemas/ApplicationStatus"},"last_applicant_submission_at":{"type":"string","format":"date-time","description":"The date of the last submission by an applicant from a sharing request."},"archived_at":{"type":"string","format":"date-time","description":"If this application has been archived, the date that it happened."},"created_at":{"type":"string","format":"date-time","description":"The date this application was created."},"updated_at":{"type":"string","format":"date-time","description":"The date this application was last updated."}},"required":["_id","reference","status","created_at","updated_at"],"description":"The core function of Akahu Apply is to provide insights over a dataset consisting of financial accounts and their transactions. An Akahu Apply **Application** represents a container where data can be added, processed, and prepared for analysis.\n\nFor example, if you are using Akahu Apply as part of a lending workflow, a new Application should be set up in Akahu Apply for each lending application being processed."},"ApplicationCreateParams":{"type":"object","properties":{"reference":{"type":"string","maxLength":500,"description":"A value used to identify the application in a way that makes sense to the creator.\n\nFor some this may include the applicant names, for others it may be a unique reference from their CRM.\n\nIt does not need to be unique."}},"required":["reference"]},"DocumentId":{"type":"string","pattern":"^doc_[a-z0-9]{24,27}$","example":"doc_tz4a98xxat96iws9zmbrgj3a"},"DocumentStatus":{"type":"string","enum":["pending","processing","completed","failed"],"description":"The status of a document:\n\n - `pending` The document record exists, but the file has not yet been fully uploaded.\n\n - `processing` Akahu Apply is extracting and enriching the data from this document.\n\n - `completed` This document has been successfully processed.\n\n - `failed` This document has not been successfully processed. See the `failure_reason` for more detail."},"DocumentFailureReasonCode":{"type":"string","enum":["internal_error","invalid_input","password_protected","timeout","malware_scan_failed","malware_detected"]},"DocumentChannelSharingRequest":{"type":"object","properties":{"type":{"type":"string","enum":["sharing_request"]},"_id":{"type":"string","pattern":"^sharing_request_[a-z0-9]{24,27}$","example":"sharing_request_tz4a98xxat96iws9zmbrgj3a","description":"The ID of the sharing request that this document was used to add this document."}},"required":["type","_id"],"description":"The document was uploaded via sharing request."},"DocumentChannelApi":{"type":"object","properties":{"type":{"type":"string","enum":["api"]}},"required":["type"],"description":"The document was uploaded via API."},"DocumentChannelPortal":{"type":"object","properties":{"type":{"type":"string","enum":["portal"]}},"required":["type"],"description":"The document was uploaded via the Akahu Apply portal."},"DocumentSourceDirectUpload":{"type":"object","properties":{"type":{"type":"string","enum":["direct_upload"]}},"required":["type"],"description":"The documented was uploaded to Akahu Apply from an external source."},"DocumentSourceOneoffObConnection":{"type":"object","properties":{"type":{"type":"string","enum":["oneoff_ob_connection"]},"_id":{"type":"string","pattern":"^oneoff_ob_connection_[a-z0-9]{24,27}$","example":"oneoff_ob_connection_tz4a98xxat96iws9zmbrgj3a","description":"The ID of the one-off open banking connection that this document was sourced from."}},"required":["type","_id"],"description":"The document was sourced directly from an open banking connection."},"DocumentRangeOutcome":{"type":"string","enum":["processed","unprocessed","skipped"],"description":"The outcome from processing a range of pages:\n\n - `processed`: The pages were processed and data has been successfully extracted.\n\n - `skipped`: The pages skipped processing. This usually occurs because any data in the document was not required in the generation of the report (eg. a blank page).\n\n - `unprocessed`: The pages were unable to be processed. This occurs if the content is not supported by Akahu Apply, or if an error occurred during processing."},"DocumentContentType":{"type":"string","enum":["blank","passport","drivers_license","financial_statement","income_statement","unknown"],"description":"The inferred type of content on a given document page:\n\n - `blank`: A blank page\n\n - `financial_statement`: A financial statement\n\n - `passport`: A passport\n\n - `drivers_license`: A drivers license\n\n - `income_statement`: An income summary or statement\n\n - `unknown`: Unknown"},"DocumentContentRange":{"type":"object","properties":{"start":{"type":"number"},"end":{"type":"number"},"outcome":{"$ref":"#/components/schemas/DocumentRangeOutcome"},"inferred_content":{"$ref":"#/components/schemas/DocumentContentType"}},"required":["start","end","outcome","inferred_content"],"description":"Describes the processing outcome of a range of pages in a document."},"DocumentContentDetails":{"type":"object","properties":{"page_count":{"type":"number"},"processed_count":{"type":"number"},"skipped_count":{"type":"number"},"unprocessed_count":{"type":"number"},"ranges":{"type":"array","items":{"$ref":"#/components/schemas/DocumentContentRange"}}},"required":["page_count","processed_count","skipped_count","unprocessed_count","ranges"]},"Document":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/DocumentId"},"_application":{"type":"string","pattern":"^application_[a-z0-9]{24,27}$","example":"application_tz4a98xxat96iws9zmbrgj3a","description":"The application that this document belongs to."},"name":{"type":"string","maxLength":255,"description":"The filename of this document."},"status":{"$ref":"#/components/schemas/DocumentStatus"},"failure_reason":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/DocumentFailureReasonCode"},"message":{"type":"string","default":"Sorry, something went wrong while processing this document. Please try again later."}},"required":["code"],"description":"If this document has failed to be processed, this field provides additional detail about what went wrong."},"channel":{"oneOf":[{"$ref":"#/components/schemas/DocumentChannelSharingRequest"},{"$ref":"#/components/schemas/DocumentChannelApi"},{"$ref":"#/components/schemas/DocumentChannelPortal"}],"discriminator":{"propertyName":"type","mapping":{"sharing_request":"#/components/schemas/DocumentChannelSharingRequest","api":"#/components/schemas/DocumentChannelApi","portal":"#/components/schemas/DocumentChannelPortal"}},"description":"The channel that was used to create the document along with any relevant metadata for that channel.\n\nThis field can be used to determine whether the document was created via a Sharing Request, API, or the Akahu Apply portal."},"source":{"oneOf":[{"$ref":"#/components/schemas/DocumentSourceDirectUpload"},{"$ref":"#/components/schemas/DocumentSourceOneoffObConnection"}],"discriminator":{"propertyName":"type","mapping":{"direct_upload":"#/components/schemas/DocumentSourceDirectUpload","oneoff_ob_connection":"#/components/schemas/DocumentSourceOneoffObConnection"}},"description":"How the document file was ingested by Akahu Apply.\n\nThis field can be used to determine whether the document was uploaded directly from an external source, or sourced from an open banking connection."},"content_details":{"$ref":"#/components/schemas/DocumentContentDetails"},"created_at":{"type":"string","format":"date-time","description":"The date that this document was created."},"updated_at":{"type":"string","format":"date-time","description":"The date that this document was last updated at."},"expires_at":{"type":"string","format":"date-time","description":"Expiry for the document, after which the record will be deleted. Expiry varies as the document progresses through its lifecycle:\n\n - While the document has a status of `pending`, expiry is short lived, ensuring that the record is cleaned up quickly if a file is never uploaded.\n\n - After the document upload has been received, a 1 year expiry is set, after which the document and all associated data will be permanently deleted."}},"required":["_id","_application","name","status","channel","source","created_at","updated_at"],"description":"**Documents** are the primary way to bring financial data into an Application for analysis.\n\nA document represents a single PDF file containing one or more financial statements relevant to the application.\n\nWhen a document is uploaded to an Application, Akahu Apply will process the information from the document and convert it to a standardised format.\n\nDocuments can be added to an application using the Akahu Apply portal, via API, or by your applicant directly using a Sharing Request.\n\nNote: Documents and their associated data expire 1 year after creation."},"ReportId":{"type":"string","pattern":"^report_[a-z0-9]{24,27}$","example":"report_tz4a98xxat96iws9zmbrgj3a"},"ReportStatus":{"type":"string","enum":["processing","completed","failed"],"description":"The status of a report:\n\n - `processing` This report is currently being synthesized.\n\n - `completed` This report has successfully been synthesized and data can now be retrieved from it.\n\n - `failed` This report has failed to be synthesized. See `failure_reason` for more information."},"ReportFailureReasonCode":{"type":"string","enum":["internal_error","timeout"]},"ReportFailureReason":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/ReportFailureReasonCode"},"message":{"type":"string","default":"Sorry, something went wrong while processing this report. Please try again later."}},"required":["code"],"description":"If a report has failed to be synthesized, this field provides additional information about what went wrong."},"ReportResourceDocument":{"type":"object","properties":{"type":{"type":"string","enum":["document"]},"_id":{"$ref":"#/components/schemas/DocumentId"}},"required":["type","_id"]},"OneoffOpenBankingConnectionId":{"type":"string","pattern":"^oneoff_ob_connection_[a-z0-9]{24,27}$","example":"oneoff_ob_connection_tz4a98xxat96iws9zmbrgj3a"},"ReportResourceOneoffOpenBankingConnection":{"type":"object","properties":{"type":{"type":"string","enum":["oneoff_ob_connection"]},"_id":{"$ref":"#/components/schemas/OneoffOpenBankingConnectionId"}},"required":["type","_id"]},"ReportResource":{"oneOf":[{"$ref":"#/components/schemas/ReportResourceDocument"},{"$ref":"#/components/schemas/ReportResourceOneoffOpenBankingConnection"}],"discriminator":{"propertyName":"type","mapping":{"document":"#/components/schemas/ReportResourceDocument","oneoff_ob_connection":"#/components/schemas/ReportResourceOneoffOpenBankingConnection"}}},"SpendingCategory":{"type":"object","properties":{"code":{"type":"string","pattern":"^spending:[0-9]{3}/[a-z0-9-]*$","example":"spending:000/useful-name-here","description":"A unique code for this spending category."},"name":{"type":"string","description":"The name of this spending category."}},"required":["code","name"],"description":"The high-level spending category for this transaction."},"IncomeCategory":{"type":"object","properties":{"code":{"type":"string","pattern":"^income:[0-9]{3}/[a-z0-9-]*$","example":"income:000/useful-name-here","description":"A unique code for this income category."},"name":{"type":"string","description":"The name of this income category."}},"required":["code","name"],"description":"The income category for this transaction"},"InsightCategoryCode":{"type":"string","pattern":"^insight:[0-9]{3}/[a-z0-9-]*$","example":"insight:000/useful-name-here"},"Report":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/ReportId"},"status":{"$ref":"#/components/schemas/ReportStatus"},"failure_reason":{"$ref":"#/components/schemas/ReportFailureReason"},"resources":{"type":"array","items":{"$ref":"#/components/schemas/ReportResource"},"description":"The resources that were used to generate this report."},"generated_at":{"type":"string","format":"date-time","description":"The date that this report completed synthesis."},"expires_at":{"type":"string","format":"date-time","description":"The date that this report expires. After this date the report will no longer be accessible."},"spending_categories":{"type":"array","items":{"$ref":"#/components/schemas/SpendingCategory"},"description":"When this report is `completed`, this field will hold a list of all spending categories used in this report."},"income_categories":{"type":"array","items":{"$ref":"#/components/schemas/IncomeCategory"},"description":"When this report is `completed`, this field will hold a list of all income categories used in this report."},"insights":{"type":"array","items":{"$ref":"#/components/schemas/InsightCategoryCode"},"description":"When this report is `completed`, this field will hold a list of all insights used in this report."}},"required":["_id","status","resources","expires_at"],"description":"Once your Application has been populated with the required data Resources, a Report can be created. A Report combines the data from all Application Resources into an aggregate, enriched dataset."},"ReportDataSourceId":{"type":"string","pattern":"^src_[a-z0-9]{24,27}$","example":"src_tz4a98xxat96iws9zmbrgj3a"},"ReportAccountId":{"type":["string","null"],"pattern":"^report_acc_[a-z0-9]{24,27}$","example":"report_acc_tz4a98xxat96iws9zmbrgj3a"},"DocumentCompleteSource":{"type":"object","properties":{"type":{"type":"string","enum":["document_complete"]},"_document":{"$ref":"#/components/schemas/DocumentId"},"filename":{"type":"string"},"page_count":{"type":"number"},"unreadable":{"type":"boolean"}},"required":["type","filename","page_count"],"description":"A data source that represents one full document."},"DocumentPartialSource":{"type":"object","properties":{"type":{"type":"string","enum":["document_partial"]},"_document":{"$ref":"#/components/schemas/DocumentId"},"filename":{"type":"string"},"page_start":{"type":"number"},"page_end":{"type":"number"}},"required":["type","filename","page_start","page_end"],"description":"A data source that represents a range of pages within a document."},"DataSourceOrigin":{"oneOf":[{"$ref":"#/components/schemas/DocumentCompleteSource"},{"$ref":"#/components/schemas/DocumentPartialSource"}],"discriminator":{"propertyName":"type","mapping":{"document_complete":"#/components/schemas/DocumentCompleteSource","document_partial":"#/components/schemas/DocumentPartialSource"}},"description":"The origin of this data source."},"DataSourceStatus":{"type":"string","enum":["unprocessed","processed","duplicate"],"description":"The status of this data source:\n\n - `processed`: This data source was successfully processed.\n\n - `unprocessed`: This data source was unable to be processed.\n\n - `duplicate`: This data source was processed, but it was identified as a duplicate."},"ReportDataSource":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/ReportDataSourceId"},"_account":{"$ref":"#/components/schemas/ReportAccountId"},"provider":{"type":["object","null"],"properties":{"_id":{"type":"string"},"name":{"type":"string"},"logo":{"type":"string","description":"A URL pointing to a logo for this provider."}},"required":["_id","name","logo"],"description":"The institution that provides data (eg. a bank, a card issuer)."},"origin":{"$ref":"#/components/schemas/DataSourceOrigin"},"status":{"$ref":"#/components/schemas/DataSourceStatus"}},"required":["_id","_account","provider","origin","status"],"description":"A Data Source represents a single data input, such as an individual bank statement. A Resource may map to one or more Data Sources (for example a PDF that includes multiple bank statements would be one resource containing multiple data sources)."},"ReportAccount":{"type":"object","properties":{"_id":{"allOf":[{"$ref":"#/components/schemas/ReportAccountId"},{"type":"string"}]},"type":{"type":"string","enum":["DEPOSITORY","CREDIT CARD","LOAN","TERM DEPOSIT","KIWISAVER","INVESTMENT","UNKNOWN"],"description":"Types of account:\n - `DEPOSITORY` A regular transactional or savings bank account.\n - `CREDIT CARD` A credit card or charge card.\n - `LOAN` A loan account, including line-of-credit accounts such as revolving home loans.\n - `TERM DEPOSIT` A term deposit.\n - `KIWISAVER` A KiwiSaver account.\n - `INVESTMENT` A generic investment account, e.g. A shares portfolio.\n - `UNKNOWN` An unsupported account type."},"identifier":{"type":["string","null"],"description":"If available, an official identifier such as an NZ bank account number or credit card number."},"name":{"type":"string"},"holder":{"type":["string","null"],"description":"The name of the account holder."},"provider":{"type":["object","null"],"properties":{"_id":{"type":"string"},"name":{"type":"string"},"logo":{"type":"string","description":"A URL pointing to a logo for this provider."}},"required":["_id","name","logo"],"description":"The institution that provides data (eg. a bank, a card issuer)."},"periods":{"type":"array","items":{"type":"object","properties":{"_source":{"type":"string","pattern":"^src_[a-z0-9]{24,27}$","example":"src_tz4a98xxat96iws9zmbrgj3a","description":"The data source that supplied information in this period"},"opening_balance":{"type":["number","null"],"description":"The opening balance for the account in this period, if available."},"closing_balance":{"type":["number","null"],"description":"The closing balance for the account in this period, if available."},"limit":{"type":["number","null"],"description":"The credit limit for the account in this period, if available."},"start":{"type":"string","format":"date-time","description":"The start date of the period."},"end":{"type":"string","format":"date-time","description":"The end date of the period."}},"required":["_source","opening_balance","closing_balance","limit","start","end"],"description":"A period of data pertaining to this account."},"description":"Periods of data that have been extracted pertaining to this account."}},"required":["_id","type","identifier","name","holder","provider","periods"],"description":"Each financial account included in the Report dataset is represented by an Account record. If data relating to the same financial account is included in multiple Resources, the data will be combined (deduplicated) into a single Account record."},"ReportTransactionId":{"type":"string","pattern":"^report_trans_[a-z0-9]{24,27}$","example":"report_trans_tz4a98xxat96iws9zmbrgj3a"},"TransactionAction":{"type":"string","enum":["money_in","money_out","transfer"],"description":"The net action of this transaction:\n\n - `money_in`: The transaction describes the inwards flow of funds (i.e. income).\n\n - `money_out`: The transaction describes the outwards flow of funds (i.e. an expense).\n\n - `transfer`: The transaction describes the transfer of funds between two accounts that are both present in the dataset provided for this report."},"TransactionType":{"type":"string","enum":["CARD","PAYMENT","TRANSFER","INTEREST","FEE","TAX","DIRECT CREDIT","DIRECT DEBIT","STANDING ORDER","ATM","FX","LOAN","KIWISAVER","CREDIT","DEBIT","UNKNOWN"],"description":"The type of transaction:\n\n - `CARD` The transaction was initiated via Credit, Debit, or EFTPOS card.\n\n - `PAYMENT` An outbound payment to another New Zealand bank account.\n\n - `TRANSFER` A money transfer between two of the user's accounts with this provider.\n\n - `INTEREST` Interest received from a savings or investment account.\n\n - `FEE` Fee paid to the institution e.g. an account fee, card fee, ATM fee.\n\n - `TAX` Tax paid on interest or other source of income.\n\n - `DIRECT CREDIT` Payment received from another party.\n\n - `DIRECT DEBIT` Direct debit payment initiated by (and paid to) a third party with prior authorization from the account holder.\n\n - `STANDING ORDER` A regular scheduled payment, aka. 'Automatic payment'.\n\n - `ATM` ATM deposit or withdrawal.\n\n - `FX` Foreign currency exchange.\n\n - `LOAN` Payments towards a loan.\n\n - `KIWISAVER` Transactions towards a KiwiSaver account.\n\n - `CREDIT` A fallback for any other money that has entered the account.\n\n - `DEBIT` A fallback for any other money that has left the account.\n\n - `UNKNOWN` An unknown transaction type.\n"},"MerchantId":{"type":"string","pattern":"^merchant_[a-z0-9]{24,27}$","example":"merchant_tz4a98xxat96iws9zmbrgj3a"},"ReportMerchant":{"type":["object","null"],"properties":{"_id":{"$ref":"#/components/schemas/MerchantId"},"name":{"type":"string"},"logo":{"type":"string","description":"A URL pointing to a logo for this merchant."}},"required":["_id","name","logo"],"example":{"_id":"merchant_cjtt1msoq000a59oj3tpw7vla","name":"Woolworths","logo":"https://cdn.akahu.nz/logos/merchants/merchant_cjtt1msoq000a59oj3tpw7vla"}},"NZFCCategoryId":{"type":"string","pattern":"^nzfcc_[a-z0-9]{24,27}$","example":"nzfcc_tz4a98xxat96iws9zmbrgj3a"},"TransactionCategory":{"type":["object","null"],"properties":{"_id":{"$ref":"#/components/schemas/NZFCCategoryId"},"name":{"type":"string"}},"required":["_id","name"],"description":"A low-level NZFCC category for this transaction. See nzfcc.org","example":{"_id":"nzfcc_ckouvvy84001608ml5p6z4d8j","name":"Supermarkets and grocery stores"}},"ReportTransaction":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/ReportTransactionId"},"_account":{"allOf":[{"$ref":"#/components/schemas/ReportAccountId"},{"type":"string"}]},"_source":{"type":"string","description":"The data source that this transaction belongs to."},"action":{"$ref":"#/components/schemas/TransactionAction"},"type":{"$ref":"#/components/schemas/TransactionType"},"date":{"type":"string","format":"date-time"},"description":{"type":"string"},"amount":{"type":"number","description":"The transaction amount. Debits are returned as negative numbers."},"balance":{"type":["number","null"],"description":"The account balance at this transaction, if available in the data source."},"merchant":{"$ref":"#/components/schemas/ReportMerchant"},"nzfcc":{"$ref":"#/components/schemas/TransactionCategory"},"income_category":{"allOf":[{"$ref":"#/components/schemas/IncomeCategory"},{"type":["object","null"]}]},"spending_category":{"allOf":[{"$ref":"#/components/schemas/SpendingCategory"},{"type":["object","null"]}]},"other_account":{"type":["string","null"],"description":"The NZ account number of the other party to this transaction, if available."},"other_loan_account":{"type":["string","null"],"description":"The loan account number of the other party to this transaction, if available."},"other_card_suffix":{"type":["string","null"],"description":"The suffix of the card account for the other party to this transaction, if available."}},"required":["_id","_account","_source","action","type","date","description","amount","balance","merchant","nzfcc","income_category","spending_category"],"description":"A record of money moving into or out of an account."},"InsightUnit":{"type":"string","enum":["count","currency","percentage"],"description":"The unit of an insight value:\n\n - `count` The value is a count. This will always be an integer greater than or equal to 0.\n\n - `currency` The value is a quantity of currency in NZD.\n\n - `percentage` The value is a percentage."},"ReportInsightCompleted":{"type":"object","properties":{"status":{"type":"string","enum":["completed"]},"code":{"type":"string","pattern":"^insight:[0-9]{3}/[a-z0-9-]*$","example":"insight:000/useful-name-here","description":"A unique code for this insight."},"description":{"type":"string","description":"A description of this insight."},"value":{"type":"number","description":"The quantity measured by the insight"},"unit":{"$ref":"#/components/schemas/InsightUnit"},"formatted":{"type":"string","description":"The value formatted for display"}},"required":["status","code","description","value","formatted"],"description":"An insight that has been successfully calculated."},"InsightFailureReasonCode":{"type":"string","enum":["internal_error","timeout","insufficient_data"],"description":"The reason for an insight's failure to be calculated:\n\n - `internal_error` An unhandled internal error prevented the calculation from completing.\n\n - `timeout` The calculation took too long and was cancelled.\n\n - `insufficient_data` The report does not contain the relevant data to calculate this insight."},"InsightFailureReason":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/InsightFailureReasonCode"},"message":{"type":"string","default":"Sorry, something went wrong while processing this insight."}},"required":["code"],"description":"If a report has failed to be synthesized, this field provides additional information about what went wrong."},"ReportInsightFailed":{"type":"object","properties":{"status":{"type":"string","enum":["failed"]},"code":{"type":"string","pattern":"^insight:[0-9]{3}/[a-z0-9-]*$","example":"insight:000/useful-name-here","description":"A unique code for this insight."},"description":{"type":"string","description":"A description of this insight."},"failure_reason":{"$ref":"#/components/schemas/InsightFailureReason"}},"required":["status","code","description","failure_reason"],"description":"An insight that has not been calculated."},"ReportInsight":{"oneOf":[{"$ref":"#/components/schemas/ReportInsightCompleted"},{"$ref":"#/components/schemas/ReportInsightFailed"}],"discriminator":{"propertyName":"status","mapping":{"completed":"#/components/schemas/ReportInsightCompleted","failed":"#/components/schemas/ReportInsightFailed"}},"description":"An insight derived from data in the report."},"ResourceStatus":{"type":"string","enum":["pending","processing","completed","failed"],"description":"The status of a resource:\n\n - `pending` The resource record exists, but has not yet been fully loaded.\n\n - `processing` The data from this record is being extracted and processed.\n\n - `completed` This resource has been successfully processed.\n\n - `failed` This resource has not been successfully processed. See the `failure_reason` for more detail."},"OneoffOpenBankingConnectionFailureReasonCode":{"type":"string","enum":["internal_error","timeout"]},"Resource":{"oneOf":[{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/DocumentId"},"_application":{"type":"string","pattern":"^application_[a-z0-9]{24,27}$","example":"application_tz4a98xxat96iws9zmbrgj3a","description":"The application that this document belongs to."},"type":{"type":"string","enum":["document"]},"status":{"$ref":"#/components/schemas/ResourceStatus"},"name":{"type":"string","maxLength":255,"description":"The filename of this document."},"failure_reason":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/DocumentFailureReasonCode"},"message":{"type":"string","default":"Sorry, something went wrong while processing this document. Please try again later."}},"required":["code"],"description":"If this document has failed to be processed, this field provides additional detail about what went wrong."},"channel":{"oneOf":[{"$ref":"#/components/schemas/DocumentChannelSharingRequest"},{"$ref":"#/components/schemas/DocumentChannelApi"},{"$ref":"#/components/schemas/DocumentChannelPortal"}],"discriminator":{"propertyName":"type","mapping":{"sharing_request":"#/components/schemas/DocumentChannelSharingRequest","api":"#/components/schemas/DocumentChannelApi","portal":"#/components/schemas/DocumentChannelPortal"}},"description":"The channel that was used to create the document along with any relevant metadata for that channel.\n\nThis field can be used to determine whether the document was created via a Sharing Request, API, or the Akahu Apply portal."},"source":{"oneOf":[{"$ref":"#/components/schemas/DocumentSourceDirectUpload"},{"$ref":"#/components/schemas/DocumentSourceOneoffObConnection"}],"discriminator":{"propertyName":"type","mapping":{"direct_upload":"#/components/schemas/DocumentSourceDirectUpload","oneoff_ob_connection":"#/components/schemas/DocumentSourceOneoffObConnection"}},"description":"How the document file was ingested by Akahu Apply.\n\nThis field can be used to determine whether the document was uploaded directly from an external source, or sourced from an open banking connection."},"content_details":{"$ref":"#/components/schemas/DocumentContentDetails"},"created_at":{"type":"string","format":"date-time","description":"The date that this document was created."},"updated_at":{"type":"string","format":"date-time","description":"The date that this document was last updated at."},"expires_at":{"type":"string","format":"date-time","description":"Expiry for the document, after which the record will be deleted. Expiry varies as the document progresses through its lifecycle:\n\n - While the document has a status of `pending`, expiry is short lived, ensuring that the record is cleaned up quickly if a file is never uploaded.\n\n - After the document upload has been received, a 1 year expiry is set, after which the document and all associated data will be permanently deleted."}},"required":["_id","_application","type","status","name","channel","source","created_at","updated_at"]},{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/OneoffOpenBankingConnectionId"},"_application":{"type":"string","pattern":"^application_[a-z0-9]{24,27}$","example":"application_tz4a98xxat96iws9zmbrgj3a","description":"The application that this open banking connection belongs to."},"type":{"type":"string","enum":["oneoff_ob_connection"]},"status":{"$ref":"#/components/schemas/ResourceStatus"},"failure_reason":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/OneoffOpenBankingConnectionFailureReasonCode"},"message":{"type":"string","default":"Something went wrong while processing this connection."}},"required":["code"],"description":"If this open banking connection has failed to complete, this field provides additional detail about what went wrong."},"created_at":{"type":"string","format":"date-time","description":"The date that this open banking connection was created."},"updated_at":{"type":"string","format":"date-time","description":"The date that this open banking connection was last updated at."}},"required":["_id","_application","type","status","created_at","updated_at"]}],"description":"Financial data is added to an Application via one or more Resources.\n\nThe data from multiple resources is compiled into a single aggregate dataset by generating a Report."},"SharingRequestId":{"type":"string","pattern":"^sharing_request_[a-z0-9]{24,27}$","example":"sharing_request_tz4a98xxat96iws9zmbrgj3a"},"SharingRequest":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/SharingRequestId"},"link":{"type":"string","format":"uri","description":"A URL to the Akahu Apply applicant sharing portal."},"created_at":{"type":"string","format":"date-time","description":"The date that this sharing request was created."},"expires_at":{"type":"string","format":"date-time","description":"The date that this sharing request will expire."},"last_submitted_at":{"type":"string","format":"date-time","description":"The date that the applicant last submitted data through this sharing request."}},"required":["_id","link","created_at","expires_at"],"description":"You can invite your applicant to provide financial data for their Application by creating a Sharing Request. Each Sharing Request is associated with a specific Application, and you can create multiple Sharing Requests per Application.\n\nUsing a Sharing Request, you can send your applicant to an Akahu Apply web page where they will be guided through the process of sharing the requested financial data. Any Resources created by the applicant during this process will automatically be attached to the associated Application."},"SharingRequestRedirectUri":{"type":"string","format":"uri","description":"The https uri to redirect to after the sharing request is used. This can contain query parameters, e.g. for passing state.\n\nThis is optional and can be used to redirect the user to a specific page after they have successfully connected their accounts. If not provided, the user will be told that they can close the page.\n\nIf the user cancels the flow without adding any statements, they will be redirected to this uri with the query parameters `applicationId={applicationId}&sharingRequestId={sharingRequestId}&action=cancelled`.\n\nIf the user adds any statements, they will be redirected to this uri with the query parameters `applicationId={applicationId}&sharingRequestId={sharingRequestId}&action=submitted`."},"CreateSharingRequestParams":{"type":"object","properties":{"requested_days":{"type":"integer","minimum":30,"maximum":365,"description":"How much historical data (i.e. bank statements) will be requested of the applicant. This is applied at the time the applicant completes the request."},"allow_manual_uploads":{"type":"boolean","description":"Determines whether the applicant is given the option to supply data manually by uploading PDF documents."},"skip_landing_page":{"type":"boolean","default":false,"description":"Skips the sharing request landing page and navigates the applicant directly to the open banking flow.\n\n`allow_manual_uploads` must be set to `false` to change the default value of this parameter."},"allow_multiple_submissions":{"type":"boolean","description":"Determines whether the applicant is allowed to submit more data if they return to the sharing request URL after submission.\n\nDefaults to the same value as `allow_multiple_ob_connections`."},"allow_multiple_ob_connections":{"type":"boolean","default":true,"description":"Determines whether the applicant is allowed to complete multiple open banking connections as part of this sharing request.\nIf set to `false`, the sharing request will submit automatically upon successful completion of an open banking connection.\n\n`allow_manual_uploads` must be set to `false` to change the default value of this parameter."},"ob_connection_filter":{"type":"array","items":{"type":"string","enum":["amex","anz","asb","bnz","coop","heartland","kiwibank","latitude","sbs","tsb","westpac"]},"minItems":1,"maxItems":1,"description":"Optionally restricts which institutions are available for connection via open banking.\nThis setting does not restrict the applicant's ability to upload documents from other institutions using the manual upload feature (if enabled).\n\nNote: This parameter currently accepts only a single value."},"redirect_uri":{"$ref":"#/components/schemas/SharingRequestRedirectUri"}},"required":["requested_days","allow_manual_uploads"]}},"parameters":{}},"paths":{"/v1/orgs/current":{"get":{"operationId":"GetCurrentOrg","tags":["Orgs"],"summary":"Get current org","description":"Details about the Akahu Apply org that this API key belongs to.","deprecated":false,"security":[{"APIKey":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Org"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}}},"/v1/applications":{"post":{"operationId":"CreateApplication","tags":["Applications"],"summary":"Create application","deprecated":false,"security":[{"APIKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplicationCreateParams"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Application"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}}},"/v1/applications/{applicationId}":{"get":{"operationId":"GetApplication","tags":["Applications"],"summary":"Get application","deprecated":false,"security":[{"APIKey":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApplicationId"},"required":true,"name":"applicationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Application"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}}},"/v1/applications/{applicationId}/archive":{"put":{"operationId":"ArchiveApplication","tags":["Applications"],"summary":"Archive application","description":"An archived application can no longer have additional resources added to it.\n\nOnce archived, an application will be securely deleted after a preset number of days, which can be configured by an Akahu Apply organisation administrator.","deprecated":false,"security":[{"APIKey":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApplicationId"},"required":true,"name":"applicationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Application"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}}},"/v1/applications/{applicationId}/unarchive":{"put":{"operationId":"UnarchiveApplication","tags":["Applications"],"summary":"Restore application","description":"If you find you want to add additional data to an archived application, it can be restored from archive.","deprecated":false,"security":[{"APIKey":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApplicationId"},"required":true,"name":"applicationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Application"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}}},"/v1/applications/{applicationId}/documents":{"post":{"operationId":"CreateDocument","tags":["Documents"],"summary":"Create document for application","description":"This endpoint creates a new document record in a `pending` state.\nEach document represents a single file, which needs to be uploaded shortly after document creation.\n\nIf the document file is not uploaded before the `expires_at` timestamp included in the response, the record will be automatically deleted.\n\nThe document file can be uploaded by making a `PUT` request to the `upload_url` provided in the response.\nDocument uploads must meet the following criteria:\n\n - Files have a maximum size of 50MB\n\n - Files must have a `content-type` of 'application/pdf'","deprecated":false,"security":[{"APIKey":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApplicationId"},"required":true,"name":"applicationId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255,"description":"The filename of this document."}},"required":["name"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"_id":{"$ref":"#/components/schemas/DocumentId"},"expires_at":{"type":"string","format":"date-time"},"upload_url":{"type":"string","format":"uri"}},"required":["_id","expires_at","upload_url"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id","application_archived"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}},"get":{"operationId":"ListDocuments","tags":["Documents"],"summary":"List documents for application","deprecated":false,"security":[{"APIKey":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApplicationId"},"required":true,"name":"applicationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Document"}}},"required":["items"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}}},"/v1/applications/{applicationId}/documents/{documentId}":{"get":{"operationId":"GetDocument","tags":["Documents"],"summary":"Get document details","deprecated":false,"security":[{"APIKey":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApplicationId"},"required":true,"name":"applicationId","in":"path"},{"schema":{"$ref":"#/components/schemas/DocumentId"},"required":true,"name":"documentId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}},"delete":{"operationId":"DeleteDocument","tags":["Documents"],"summary":"Delete document","deprecated":false,"security":[{"APIKey":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApplicationId"},"required":true,"name":"applicationId","in":"path"},{"schema":{"$ref":"#/components/schemas/DocumentId"},"required":true,"name":"documentId","in":"path"}],"responses":{"204":{"description":"Accepted"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id","application_archived"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}}},"/v1/applications/{applicationId}/documents/{documentId}/download":{"get":{"operationId":"DownloadDocument","tags":["Documents"],"summary":"Download document","deprecated":false,"security":[{"APIKey":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApplicationId"},"required":true,"name":"applicationId","in":"path"},{"schema":{"$ref":"#/components/schemas/DocumentId"},"required":true,"name":"documentId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/pdf":{"schema":{"type":"string"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id","document_locked"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}}},"/v1/applications/{applicationId}/reports":{"post":{"operationId":"CreateReport","tags":["Reports"],"summary":"Create report","description":"An Akahu Apply report provides an aggregate, enriched view of the data from the application's resources.\n\nThe output of a report can be downloaded as an HTML document for human consumption, or as JSON data for further processing.\n\nReport processing is asynchronous, so you must poll the `GET /v1/applications/{applicationId}/report/{reportId}` endpoint until it reaches a final status. The output of a report can only by accessed once it has been assigned a status of `completed`.","deprecated":false,"security":[{"APIKey":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApplicationId"},"required":true,"name":"applicationId","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"_documents":{"type":"array","items":{"$ref":"#/components/schemas/DocumentId"},"minItems":1,"description":"Optionally specify which documents to include in the report. If omitted, all documents in the application will be included.\n\nThe provided value must reference a subset of the documents from this application. Documents from other applications cannot be included."}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id","report_insufficient_data","report_documents_processing"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}}},"/v1/applications/{applicationId}/reports/{reportId}":{"get":{"operationId":"GetReport","tags":["Reports"],"summary":"Get report details","deprecated":false,"security":[{"APIKey":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApplicationId"},"required":true,"name":"applicationId","in":"path"},{"schema":{"$ref":"#/components/schemas/ReportId"},"required":true,"name":"reportId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}}},"/v1/applications/{applicationId}/reports/{reportId}/html":{"get":{"operationId":"GetReportHtmlDownload","tags":["Reports"],"summary":"Download report HTML","deprecated":false,"security":[{"APIKey":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApplicationId"},"required":true,"name":"applicationId","in":"path"},{"schema":{"$ref":"#/components/schemas/ReportId"},"required":true,"name":"reportId","in":"path"}],"responses":{"200":{"description":"Success","content":{"text/html":{"schema":{"type":"string"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id","report_processing"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}}},"/v1/applications/{applicationId}/reports/{reportId}/json":{"get":{"operationId":"GetReportJsonDownload","tags":["Reports"],"summary":"Download all report data as a single JSON file","deprecated":false,"security":[{"APIKey":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApplicationId"},"required":true,"name":"applicationId","in":"path"},{"schema":{"$ref":"#/components/schemas/ReportId"},"required":true,"name":"reportId","in":"path"}],"responses":{"204":{"description":"Accepted"},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id","report_processing"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}}},"/v1/applications/{applicationId}/reports/{reportId}/data-sources":{"get":{"operationId":"GetReportDataSources","tags":["Reports"],"summary":"Get report data sources","description":"A data source represents a single financial statement. Note that in the case of multiple statements merged into a single file, there may be multiple data sources pointing to a single document.\n\n**Note**: This endpoint is paginated. To list all data source records, it may be necessary to loop through all available pages using the `cursor` returned with each response.","deprecated":false,"security":[{"APIKey":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApplicationId"},"required":true,"name":"applicationId","in":"path"},{"schema":{"$ref":"#/components/schemas/ReportId"},"required":true,"name":"reportId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ReportDataSource"}},"cursor":{"type":["string","null"]}},"required":["items","cursor"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id","report_processing","invalid_cursor","expired_cursor"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}}},"/v1/applications/{applicationId}/reports/{reportId}/accounts":{"get":{"operationId":"GetReportAccounts","tags":["Reports"],"summary":"Get report accounts","description":"**Note**: This endpoint is paginated. To list all Account records, it may be necessary to loop through all available pages using the `cursor` returned with each response.","deprecated":false,"security":[{"APIKey":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApplicationId"},"required":true,"name":"applicationId","in":"path"},{"schema":{"$ref":"#/components/schemas/ReportId"},"required":true,"name":"reportId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ReportAccount"}},"cursor":{"type":["string","null"]}},"required":["items","cursor"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id","report_processing","invalid_cursor","expired_cursor"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}}},"/v1/applications/{applicationId}/reports/{reportId}/transactions":{"get":{"operationId":"GetReportTransactions","tags":["Reports"],"summary":"Get report transactions","description":"**Note**: This endpoint is paginated. To list all Transaction records, it may be necessary to loop through all available pages using the `cursor` returned with each response.","deprecated":false,"security":[{"APIKey":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApplicationId"},"required":true,"name":"applicationId","in":"path"},{"schema":{"$ref":"#/components/schemas/ReportId"},"required":true,"name":"reportId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ReportTransaction"}},"cursor":{"type":["string","null"]}},"required":["items","cursor"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id","report_processing","invalid_cursor","expired_cursor"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}}},"/v1/applications/{applicationId}/reports/{reportId}/insights":{"get":{"operationId":"GetReportInsights","tags":["Reports"],"summary":"Get report insights","description":"**Note**: This endpoint is paginated. To list all Insight records, it may be necessary to loop through all available pages using the `cursor` returned with each response.","deprecated":false,"security":[{"APIKey":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApplicationId"},"required":true,"name":"applicationId","in":"path"},{"schema":{"$ref":"#/components/schemas/ReportId"},"required":true,"name":"reportId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ReportInsight"}},"cursor":{"type":["string","null"]}},"required":["items","cursor"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id","report_processing","invalid_cursor","expired_cursor","feature_disabled"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}}},"/v1/applications/{applicationId}/resources":{"get":{"operationId":"ListResources","tags":["Resources"],"summary":"List resources for application","description":"Financial data is added to an Application via one or more Resources. The data from multiple resources is compiled into a single aggregate dataset by generating a Report.","deprecated":false,"security":[{"APIKey":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApplicationId"},"required":true,"name":"applicationId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Resource"}}},"required":["items"]}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}}},"/v1/applications/{applicationId}/sharing-request":{"post":{"operationId":"CreateSharingRequest","tags":["Sharing Requests"],"summary":"Create sharing request","deprecated":false,"security":[{"APIKey":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApplicationId"},"required":true,"name":"applicationId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSharingRequestParams"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharingRequest"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id","application_archived"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}}},"/v1/applications/{applicationId}/sharing-request/{sharingRequestId}":{"get":{"operationId":"GetSharingRequest","tags":["Sharing Requests"],"summary":"Get a sharing request","deprecated":false,"security":[{"APIKey":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApplicationId"},"required":true,"name":"applicationId","in":"path"},{"schema":{"$ref":"#/components/schemas/SharingRequestId"},"required":true,"name":"sharingRequestId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharingRequest"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["invalid_type","too_big","too_small","invalid_format","not_multiple_of","unrecognized_keys","invalid_union","invalid_key","invalid_element","invalid_value","invalid","invalid_id"]}}}]}}},"required":["issues"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["unauthorized"]}}}]}}},"required":["issues"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["forbidden"]}}}]}}},"required":["issues"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["not_found"]}}}]}}},"required":["issues"]}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["too_many_requests"]}}}]}}},"required":["issues"]}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","properties":{"issues":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/APIIssue"},{"type":"object","properties":{"code":{"type":"string","enum":["internal_error"]}}}]}}},"required":["issues"]}}}}}}}},"webhooks":{}}