Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions content/data/insights/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ visible_in_sidebar: true

Here is a quick summary of steps to help you integrate with Setu’s Insights API. Before you start, there are some key terms that will be referred to periodically in the documentation—

- **Reference Id**—Developers can define an identifier to manage and track one customer's data points. This identifier is used throughout the lifecycle to push data, generate insights and finally purge any data from the system.
- **Reference Id**—Developers can define an identifier to manage and track one customer's data points. This `refId` groups together all data for a single analysis session and is used throughout the lifecycle to push data and generate insights.
- **FI Data block**—FI Data blocks are the data received from the FIP (Financial information provider), via the AA. Currently, we support bank statement, equities, mutual_fund and etf datablocks. In addition, we support ePDF-based bank statements for Indian banks.
- **Template**—A template is a pre-configured format that determines the structure of the generated report, including which insights to generate. You can pick and choose exactly what insights should be added to a template, based on your needs.
For example, if you only want to generate income and expense insights of a customer, the template can contain only those two insights.
Expand Down Expand Up @@ -41,40 +41,40 @@ Send the following details to [insights@setu.co](mailto:insights@setu.co) —
| **Insights required** | A list of required Insights. Send an email to [insights@setu.co](mailto:insights@setu.co) for full list of insights. |
| **Output format** | Format in which you need the output — currently we support `JSON`, and `XLSX`. |

#### Option 2: Use API to create/update template
#### Option 2: Use API to create a template

You can create (`POST /v2/template`) or update (`PUT /v2/template`) templates via API. See <a href="/data/insights/quickstart/api-integration">API Integration</a> for details.
You can create templates via API using `POST /v3/template`. See <a href="/data/insights/quickstart/api-integration">API Integration</a> for details.

Setu will respond with a `templateId`, which is required to generate insight reports.

<hr className="primary" />

### Step 2—Ingest data

Once you have the user’s financial data, you can push it to Setu Insights using:
Once you have the user’s financial data, you can push it to Setu Insights. Use a single `refId` for each customer to group all their data for an analysis session. You can call the endpoint multiple times with the same `refId` to upload data for different accounts.

- **AA-sourced JSON** – Use `/v2/fiData`
- **Bank PDF statements** – Use `/v2/pdf-ingest` for PDF uploads
- **AA-sourced JSON** – Use `POST /v3/fiData`. The request body can contain data for a single account or an array of accounts.
- **Bank PDF statements** – Use `/v3/pdf-ingest` for PDF uploads

Use a single `refId` per customer. See the <a href="/data/insights/quickstart/api-integration">API Integration</a> section for details.

<hr className="primary" />

### Step 3—Generate insights
You can generate insights for each customer that is created in the previous step. To generate insights, pass the `templateId` and `refId` from the previous steps.
### Step 3—Generate and retrieve insights

Use the `templateId` and `refId` to generate insights with the `/v2/report` API.
You can generate insights for each customer using the `refId` from the data ingestion step. This is a two-step process:

- You’ll receive a `reportId` in response
- Insights will be sent to your webhook URL
- You can fetch reports later using this `reportId`
- Refer <a href="/data/insights/quickstart/api-integration" target="_blank">API integration</a> to integrate with Insight generation APIs.
First, you trigger an asynchronous job to generate insights by calling `POST /v3/insight` with a `refId` and a `templateId`. A successful request queues the job and returns a `reportId`.

Then, you retrieve the results. The generated insights can be sent to your webhook URL, or you can poll the `GET /v3/insight?reportId={reportId}` endpoint to get the report.

Refer <a href="/data/insights/quickstart/api-integration" target="_blank">API integration</a> to integrate with Insight generation APIs.

<hr className="primary" />

### Step 4 — (Optional) Purge Customer Data

You can delete a customer’s data from Setu using the `refId` via the `/v2/purge` API. This is useful for meeting data minimization and regulatory compliance requirements such as user data deletion requests under privacy laws.
You can delete a customer’s data from Setu using the `refId` via the `/v3/purge` API. This is useful for meeting data minimization and regulatory compliance requirements such as user data deletion requests under privacy laws.

When a purge is triggered:

Expand Down
Loading