# Reauthorizing Connections in an Integrated Account

> Source: https://truto.one/docs/guides/integrated-accounts/reauthorizing-connections/

Sometimes, you may need to refresh your connection to an integration in Truto. This could be because of changes to your integration settings or updates in the integration itself. Reauthorizing your connection will allow the integration to continue to work properly with the updated information.

## Getting notified about reauthorization

In case of OAuth integrations, when an end-user revokes access for the OAuth app, Truto will not be able to refresh the access tokens. In such cases, whenever Truto tries to refresh the access token and fails to do so, it will send an `integrated_account:authentication_error` which will contain the integrated account as the payload. You can use this event to notify the end-user about the issue and ask them to re-authorize the connection.

For OAuth with refresh token functionality, the `integrated_account:authentication_error` event will be sent when there is an issue with refreshing the access token for an integrated account regardless of what the underlying issue is.

For other authentication methods and OAuth without refresh token functionality, the event will be sent when an underlying API call to the integration is made, and it fails with 401 response status code. This can happen when proxy and unified APIs are called, or when Sync Jobs are run.

> [Webhooks Guide](/docs/guides/webhooks/overview)

## Reauthorize Connections via Truto interface

Follow these simple steps:

1. **Sign into Truto** and go to the `Integrated Accounts` section or click [here](https://app.truto.one/integrated-accounts).
   ![Select an Integrated account](https://docs-assets.truto.one/select-integrated-account.png)
2. **Select an Integrated Account**. In the account details, you will find an option labeled 'Connection'.
   ![Select Re-authorize connection](https://docs-assets.truto.one/reauthorize-integrated-account.png)
3. **Click on 'Reauthorize connection'**. A new window will open.
   ![Select Get connection link](https://docs-assets.truto.one/reauthorize-connection.png)
4. **Click on 'Get connection link'** and then on the 'Magic Link' for re-authorization. Alternatively, you can share this magic link with your customer to allow them to connect their account.
   ![Select link and complete auth](https://docs-assets.truto.one/reauthorize-link.png)

### What happens next?

After clicking on the Magic Link, you will be redirected to your account on the integrated platform. You will have to log in and allow access to Truto. Follow the steps for authentication, and upon successful completion, you will see a 'Connection successful' message. You can then close the tab.

## Reauthorizing an account via API

Use the following cURL command to generate a link-token. Truto uses Bearer authorization, replace the `<your-api-token>` in the command below with your API token.

> [Create Link Token API Reference](/docs/api-reference/admin/link-token/create#reauthorizing-an-integrated-account)

```bash
curl --location 'https://api.truto.one/link-token' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your-api-token>' \
--data '{
    "integrated_account_id": "<integrated-account-id>"
}'
```
Response:
```json
{
    "link_token": "e73c7b9b-2e4d-47d1-b5d2-83441fd24e4c"
}
```

Use the following URL, to launch Truto's connection UI. Remember to replace `<link-token-from-previous-step>` with the actual link token received from the API request.

```http
https://app.truto.one/connect-account?link_token=<link-token-from-previous-step>
```

### Embedding the linking flow within your app

You can also use our Frontend Link SDK to embed the connection flow within your UI. More details [here](/docs/guides/link-sdk/how-to-embed).

With this, your Re-authorization process is complete! You've now ensured that your Truto integration will continue to work properly, even with the updated information.
