> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flinks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve Account Data

> Call /GetAccountsDetail to retrieve account data, then handle the 202 polling flow or use webhooks.

After a customer connects their bank account through Flinks Connect, you retrieve their financial data by calling the `/GetAccountsDetail` endpoint. This page explains the full data retrieval flow.

## Prerequisites

Before calling `/GetAccountsDetail`, you need a valid `RequestId`. To obtain one:

1. Retrieve the `loginId` from the Flinks Connect [event listener](./flinks-connect/use-event-listener) or [redirect URL](./next-steps#save-your-loginids).
2. Call [`/Authorize`](../../api/authorize/endpoints/authorize) with the `loginId` to get a `RequestId`.

<Warning>
  Store the `loginId` on your server. The `loginId` does not expire and is required for future data retrieval. The `RequestId` is session-scoped: it expires on timeout and is consumed once `/GetAccountsDetail` completes, so a further live retrieval needs a new `/Authorize` call. In cached mode, a cached `RequestId` is not consumed by cached `/GetAccountsDetail`.
</Warning>

## Call /GetAccountsDetail

Send a `POST` request to [`/GetAccountsDetail`](../../api/connect/endpoints/account-linking/get-accounts-detail) with the `RequestId` in the body.

The endpoint returns account data including personal information, account details, and transaction history. See the [API reference](../../api/connect/endpoints/account-linking/get-accounts-detail#accounts-detail) for the full list of returned fields.

## Handle the response

`/GetAccountsDetail` returns one of two responses:

* **`200`**: Data is ready. The response contains the full account payload.
* **`202`**: Data is still processing. You must poll `/GetAccountsDetailAsync` to retrieve the data when it's ready.

A `202` response is expected on the initial call. Most requests finish processing within a few seconds.

## Poll /GetAccountsDetailAsync on 202

When you receive a `202` from `/GetAccountsDetail`:

1. Call [`/GetAccountsDetailAsync`](../../api/connect/endpoints/account-linking/get-accounts-detail-async) with the same `RequestId` as a path parameter. This is a `GET` request.
2. If the response is `202`, the data is still processing. Wait 10 seconds, then call `/GetAccountsDetailAsync` again.
3. Repeat until you receive a `200` response. The `200` response contains the same payload as a `200` from `/GetAccountsDetail`.
4. Set a maximum timeout of 30 minutes to avoid infinite polling loops.

<Note>
  `/GetAccountsDetailAsync` is not a separate data endpoint. It is the polling mechanism for `/GetAccountsDetail`. You only call it after receiving a `202` from `/GetAccountsDetail`.
</Note>

## Refresh account data

To fetch fresh data for an already-connected user, call `/Authorize` with `MostRecentCached: false` and `Save: true`. This triggers a live re-authorization with the financial institution instead of returning cached data. If the bank requires MFA, `/Authorize` returns a `203` and the user must answer a challenge before fresh data is available.

For the full refresh flow, including handling `203` MFA (relaunching Flinks Connect, then a cached authorize to get a fresh `requestId`), see [Reconnect](./resume-and-reconnect).

## Alternative: use webhooks

Instead of polling `/GetAccountsDetailAsync`, you can configure a [webhook](../../api/connect/webhooks) to receive the data automatically when processing completes.

With webhooks, Flinks sends a `POST` callback to your endpoint containing the same payload as a `/GetAccountsDetail` `200` response. This eliminates the need for polling logic.

Webhook setup requires a ticket via [Flinks Support Portal](https://help.flinks.com/support/home). Webhooks cannot be tested in sandbox environments.

For more details, see the [Webhooks documentation](../../api/connect/webhooks).
