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

# Create a refresh intent

> Create a RefreshIntent with the Fintoc API to request an on-demand refresh of a Link and pull the latest bank account data outside the normal schedule.

## Send the request

Create a [`RefreshIntent`](/api/movements-api/refresh-intents) to request an on-demand update of a `Link`.

```bash theme={null}
curl --request POST "https://api.fintoc.com/v1/refresh_intents?link_token=link_000000000_token_00000000" \
--header 'Authorization: sk_live_0000000000000000' \
--header 'Content-Type: application/json'
```

```javascript theme={null}
import { Fintoc } from 'fintoc';

async function main() {
  const fintoc = new Fintoc('sk_live_0000000000000000');
  const refreshIntent = await fintoc.refreshIntents.create({
    link_token: 'link_000000000_token_00000000',
  });

  console.log(refreshIntent.serialize());
}

main();
```

```python theme={null}
from fintoc import Fintoc

fintoc = Fintoc("sk_live_0000000000000000")
refresh_intent = fintoc.refresh_intents.create(
  link_token="link_000000000_token_00000000"
)

print(refresh_intent.serialize())
```

## Handle the response

The API returns a [`RefreshIntent` object](/api/movements-api/refresh-intents/refresh-intents-object):

```json theme={null}
{
    "id": "ri_ml4K3O4RSvALRjnV",
    "requires_mfa": null,
    "object": "refresh_intent",
    "refreshed_object": "link",
    "refreshed_object_id": "link_000000000",
    "status": "created",
    "created_at": "2021-12-07T20:40:53.513Z",
    "type": "only_last"
}
```

Use the response `id` to [get the refresh intent](/api/movements-api/refresh-intents/refresh-intents-get).

If `requires_mfa` is `null`, wait for Fintoc to send a `refresh_intent.succeeded` webhook event. Otherwise, open the widget so your user can complete multifactor authentication. The response then includes the widget token:

```json theme={null}
{
    "id": "ri_ml4K3O4RSvALRjnV",
    "requires_mfa": {
        "widget_token": "ri_ml4K3O4RSvALRjnV_sec_29K7Ar45AiSFnSgLgDx7nGHX"
    },
    "object": "refresh_intent",
    "refreshed_object": "link",
    "refreshed_object_id": "link_000000000",
    "status": "created",
    "created_at": "2021-12-07T20:40:53.513Z",
    "type": "only_last"
}
```

Open the widget with `requires_mfa.widget_token` to complete the refresh.
