---
title: Fetch BSA Report
slug: api-marketplace/fetch-bsa-report
description: Learn about Account Aggregator, a decentralized data sharing system for regulated entities to share user data. This document covers retrieving transactional data and future additions, along with API guidelines for requesting user consent through SMS. Expl
createdAt: 2022-10-14T04:13:59.000Z
---

## Introduction

The Fetch Report API enables users to retrieve the Bank Statement Analytics report generated through the Create BSA Report API or Directly using consentHandle/sessionId as requestId (NEW AA Flow reduces API Integration). With this API, users can easily access and download the report in a preferred format, facilitating seamless integration into existing systems or workflows. It provides a quick and efficient way to obtain detailed financial insights, supporting decision-making processes in lending, financial planning, and risk management.

## API Input Guidelines

Need to pass on the following information:

New Account Aggregator flow starting with /consent/start endpoint

:::Paragraph{indent="1"}
requestId - requestId should be consentHandle for ONETIME, sessionId/consentHandle for PERIODIC
:::

OLD Account Aggregator flow starting with /consent-request endpoint

- reportId / requestId - request will be request id of consent request api response for single consent flow/ requestId - consentHandleId of multiconsent flow / requestId - Fi request api response requestId

::::Tabs
:::Tab{title="Preproduction"}
```curl
curl --request POST \
  --url https://api-preproduction.signzy.app/api/v3/account-aggregator-switch/fetch-bsa \
  --header 'Authorization: <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "requestId":"<check api input desc>" // any one of reportId or requestId
	"reportId": "<reportId generated while calling create bsa>",
	"getTransactions": true
}'
```
:::

:::Tab{title="Production"}
```curl
curl --request POST \
  --url https://api.signzy.app/api/v3/account-aggregator-switch/fetch-bsa \
  --header 'Authorization: <token>' \
  --header 'Content-Type: application/json' \
  --data '{
	"reportId": "<reportId generated while calling create bsa>"
	"getTransactions": true
}'
```
:::
::::

### Input Parameters

| **PARAMETER NAME** | **REQUIRED**/**OPTIONAL**                       | **DESCRIPTION**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | **TYPE** |
| ------------------ | ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| reportId           | Required                                        | Unique reportId received in create Bsa                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | String   |
| templateId         | Required                                        | CUstomized Output accoding to JSON                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | String   |
| getTransactions    | Optional                                        | All transaction json link                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | Boolean  |
| requestId          | Condition Required either reportId or requestId | **New Account Aggregator API's Flow**<br />1. for ONETIME Consent Templates requestId will be consentHandle recieved in /consent/start  API response<br />2. for PERIODIC Consent Templates requestId will be sessionId recieved in /consent/data/request API response (recommended) or can also use consentHandle from /consent/start to get latest session report.<br />**OLD Account Aggregator Flow**<br />1. request will be request id of consent request api response for single consent flow.<br />2. requestId - consentHandleId of multiconsent flow<br />3. requestId - Fi request api response requestId | String   |

### Sample Response

:::CodeblockTabs
JSON reportId case

```json
{
    "result": {
        "json": "<Json-link>",
        "excel": "<Excel-link>"
    }
}
```

JSON requestId case

```json
{
    "requestId": "fa4e8770-ca8e-4d85-a26f-50fe3e6ebaa9",
    "status": {
        "flowStatus": "SUCCESS",
        "consentStatus": "ACTIVE",
        "dataFetchStatus": "SUCCESS",
        "analysisStatus": "SUCCESS"
    },
    "result": {
        "json": "https://files-preproduction.signzy.tech/api/files/47348936/download/e7dc072997984c74903f4d9e0b2dd50066e1e77c9fc3417396e190df6c0d62ad.json",
        "excel": "https://files-preproduction.signzy.tech/api/files/47348934/download/6e25cff1beee40f28f7139f0b447b58b4054d67c1c2145eabd41ea7bcb51bf07.xlsx",
        "base64Excel": "https://files-preproduction.signzy.tech/api/files/47348935/download/c8fd704463b8408daac4397783ea04fc2ff283199abf4e93abcc8d779d0f958a.txt",
        "accountLevelAnalysis": [
            {
                "accountId": "5904",
                "bankName": "Millennium Bank",
                "excel": "https://files-preproduction.signzy.tech/api/files/47348930/download/11867c1404b94245b2a8095ab9f35c3643eeb5ec916a4af4a5c63278255caaae.xlsx"
            }
        ],
        "transactionsJsonUrl": [
            {
                "accountId": "5904",
                "bankName": "Millennium Bank",
                "json": "https://preproduction-persist.signzy.tech/api/files/47348911/download/fb18826b7e1e41abb33587ec024dc12248d60741eba0424e928ac2558c0a9080.json"
            }
        ]
    },
    "files": [
        {
            "base64Url": "https://staging-persist.signzy.tech/api/files/27092/download/bc0943c9f2934ea8afc13cd7b1172dc93eeb0b43262a43979bc9ca09a6cf7a99.txt",
            "fileUrl": "https://staging-persist.signzy.tech/api/files/27091/download/f929a77ddd2b421297b2c7723a36af81cd1cfe5c7cdd44ee928cc3f44ae6bf9f.json"
        }
    ]
}
```
:::

### Output Parameter

| **PARAMETER NAME**         | **DESCRIPTION**                         | **TYPE** |
| -------------------------- | --------------------------------------- | -------- |
| result                     | Contains Excel and JSON file urls       |          |
| result.json                | Public URL of the JSON report           | String   |
| result.excel               | Public URL of the Excel report          |          |
| result.transactionsJsonUrl | URLs of the bank statement transactions | Array    |



## Error Codes

| Error Code | Description                                                                                    |
| ---------- | ---------------------------------------------------------------------------------------------- |
| 400        | Bad Request: In case the request is not as per required schema or any other case               |
| 401        | Unauthorized: Authentication failed or user does not have permissions for requested operation. |
| 409        | Upstream Error/Conflict: Something wrong on AA's side.                                         |
| 500        | Internal Server Error: An error occurred on the server.                                        |

##

:::hint{type="info"}
### Getting help

Please feel free to contact us if you have any questions, require clarification, or have ideas for how to make the documents or any of our services better.


You can reach out to us at [help@signzy.com](#).
:::

