## Consent Refresh

Get the latest data from a connected user's account information by fetching the most up-to-date data for the consent. **This feature is only available for Stored Data customers.**

Atto APIs and Atto Dashboard allow data refreshes of consents to update stored account, balance, and transaction data.

### Starting refresh flow

To refresh a consent via our APIs:

1. Get an access token for Stored Data API using the [Authorization
API](/content/apis/get-token) (scope should be `api:stored_data`).
2. Send a POST request using the [refresh endpoint](/content/apis/bank-data-(stored)/paths/~1stored-data~1v1~1consents~1%7Bconsentid%7D~1refresh/post) along with the consent ID at:
`https://uk.api.atto.co/stored-data/v1/consents/{consentId}/refresh`


#### Example Responses


```
{
  "statusCode": 200,
  "message": "Successfully completed data refresh"
}
```


```
{
  "statusCode": 403,
  "message": "The consent or account access has been revoked"
}
```


```
{
  "statusCode": 409,
  "message": "A refresh is already in progress for this consent"
}
```

br
To refresh a consent via Atto Dashboard:

1. Navigate to the user whose data you would like to refresh.
2. Click on the button under customer's name with the consent status information.


![Consent Refresh flow step 1](/assets/refresh-flow-1.5fc0032b21573ebab573ebdd7b459174c1c02caca25577b358b5ba17987c32fd.d5e2313b.png)

1. Click on `Refresh Data` button in the pop-up consent information dialogue.


![Consent Refresh flow step 2](/assets/refresh-flow-2.fbc5ca53e5a24a7767ad806ecc7c5965780e2b24af47f579c34131c0346592a3.d5e2313b.png)

1. The consent refresh request is now triggered and the consent status should change to `Refreshing consent...` while an up-to-date copy of data is retrieved and saved. Once successful, the consent status should revert back to display the consent expiry information.


![Consent Refresh flow step 3](/assets/refresh-flow-3.4b6f2c94c4be83810d5d203a6bd834fb09da714124a101f217a9b95b63923ab1.d5e2313b.png)
![Consent Refresh flow step 4](/assets/refresh-flow-4.97a54a71d6a50406370e96d0bb51ebe5729a1d9ea0806a1c9d8cdcd5227d16c9.d5e2313b.png)
![Consent Refresh flow step 5](/assets/refresh-flow-5.77296796a0cf1650d5c7085a342dd2928fe498f417bd42817a0f31f12560bfb4.d5e2313b.png)

> Note: If the customer has enabled multi-factor authentication (MFA), we may be unable to get up-to-date information for the user.


#### API Flow

![Consent Refresh API flow
diagram](/assets/refresh-api-flow.96a64196577e911fea38a897b423052ce63ca1518715d406cf352417099a3cd5.d5e2313b.png)

### Staggering Requests

Since refresh requests are quite data-intensive and may take several seconds to complete, it is recommended to stagger batch refresh requests according to our [api rate limits](/content/docs/guides/platform-integration/api-rate-limits).

We advise sending no more than 30 refresh requests over a 60 second period for smooth processing.

### Refresh Rules

To keep it consistent across banks, only certain data is refreshed.

- Account details with the exception of party data is always refreshed.
- Balances are always refreshed.
- Transactions are aggregated i.e. new data is merged with old data based on `transactionId` if that is present otherwise it is done using date of the transaction.
- Any other data is not refreshed and will be kept from the initial connection.


**Please note that only 4 refreshes per consent are allowed in a 24 hour period.**