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

# Error Codes

> Handle errors returned by the Link SDK and embedded connection experience.

Link errors: common causes and troubleshooting.

## Overview

When a user encounters an error in Link, they are shown an error screen that displays suggestions for resolving the particular issue. *For easier troubleshooting, we recommend you include the* `onError` *[callback](https://docs.argyle.com/link/reference/callbacks.md#onerror) in your Link initialization.*

The `onError` callback returns:

```json theme={}
LinkError (
    "userId": String,           // ID of the user
    "errorType": String (enum), // Error name
    "errorMessage": String,     // User message
    "errorDetails": String      // Error details
)
```

## Link errors

### `callback_undefined`

> [tab] User message
>
> This page does not exist. Reach out to \[Company name] for help.

> [tab] Error details
>
> Reason: callback undefined (`onCantFindItemClicked`)

> [tab] Common causes
>
> The **Callback** experience type was selected for **"If no results"** when customizing a [Link Flow](https://console.argyle.com/flows), but the `onCantFindItemClicked` callback was not included in the Link initialization.

> [tab] Troubleshooting
>
> Include the `onCantFindItemClicked` callback in your Link initialization.

![callback\_undefined Link error](https://mintcdn.com/argyle/0Z2zBY-iD5Q5BvPN/images/argyle-guides/link/error-codes/1-callback-undefined.png?fit=max\&auto=format\&n=0Z2zBY-iD5Q5BvPN\&q=85\&s=8190946f48b2528a1bd366b8521a119e)

### `duplicate_account`

> [tab] User message
>
> This User ID is already associated with a connected account. Please try a different User ID to connect another account.

> [tab] Error details
>
> none

> [tab] Common causes
>
> The user attempted to connect an already-connected account.

> [tab] Troubleshooting
>
> Advise the user to double-check which log in credentials they currently or originally used for the intended employer.

![duplicate\_account Link error](https://mintcdn.com/argyle/0Z2zBY-iD5Q5BvPN/images/argyle-guides/link/error-codes/13-duplicate-account.png?fit=max\&auto=format\&n=0Z2zBY-iD5Q5BvPN\&q=85\&s=bde21c89bda94211004d811e37940da6)

### `embedded_employer_inaccessible`

> [tab] User message
>
> We couldn’t reach \[Company name] from your current setup. Try connecting the same way you normally sign in to \[Company name]. These are the most common things to check:
>
> * Connect to your company VPN or network
> * Use an approved work device

> [tab] Error details
>
> none

> [tab] Common causes
>
> Link could not load the employer's embedded login page. The employer may require access through a company VPN or network, or from an approved work device.

> [tab] Troubleshooting
>
> Advise the user to connect to their company VPN or network, use an approved work device, and try again.

![embedded\_employer\_inaccessible Link error](https://mintcdn.com/argyle/hRBomb_ZRxtZeKm2/images/argyle-guides/link/error-codes/14-embedded-employer-inaccessible.png?fit=max\&auto=format\&n=hRBomb_ZRxtZeKm2\&q=85\&s=4ef94f3c6aef12648317d30c79caa01a)

### `expired_user_token`

> [tab] User message
>
> The service is experiencing connection problems. Please try again later.

> [tab] Error details
>
> User ID: `<ID of the user>` (see [user ID](https://docs.argyle.com/api-reference/users.md))
>
> Reason: expired `userToken`

> [tab] Common causes
>
> Link was initialized with an expired user token, or the user token expired during the Link session.

> [tab] Troubleshooting
>
> Create a new user token, and either:
>
> 1. Re-initialize Link with the new user token.
> 2. Pass the new user token to the `onTokenExpired` [callback](https://docs.argyle.com/link/reference/callbacks.md#ontokenexpired) to continue the existing Link session.

![expired\_user\_token Link error](https://mintcdn.com/argyle/0Z2zBY-iD5Q5BvPN/images/argyle-guides/link/error-codes/4-expired-user-token.png?fit=max\&auto=format\&n=0Z2zBY-iD5Q5BvPN\&q=85\&s=063a02ef72fe1816e66c966de4bd1c20)

### `generic`

> [tab] User message
>
> The service is experiencing connection problems. Please try again later.

> [tab] Error details
>
> none

> [tab] Common causes
>
> An unexpected error occurred. We are looking into it.

> [tab] Troubleshooting
>
> Contact our support team for more details.

![generic Link error](https://mintcdn.com/argyle/0Z2zBY-iD5Q5BvPN/images/argyle-guides/link/error-codes/5-generic.png?fit=max\&auto=format\&n=0Z2zBY-iD5Q5BvPN\&q=85\&s=dae9f9d04b669553c5d3a7d09d78712f)

### `invalid_account_id`

> [tab] User message
>
> The page does not exist. Reach out the \[Company] for help.

> [tab] Error details
>
> Reason: invalid accountId

> [tab] Common causes
>
> An invalid `accountId` was used for [direct login to an existing account](https://docs.argyle.com/workflows/account-connections.md#existing-connections) when initializing Link.

> [tab] Troubleshooting
>
> Use the [accounts API endpoint](https://docs.argyle.com/api-reference/accounts.md#list) with the user's `id` as a query parameter to see a list of valid `accountId`'s for the user.

![invalid\_account\_id Link error](https://mintcdn.com/argyle/0Z2zBY-iD5Q5BvPN/images/argyle-guides/link/error-codes/7-invalid-account-id.png?fit=max\&auto=format\&n=0Z2zBY-iD5Q5BvPN\&q=85\&s=0fa500248769b6d9b4e56ce730533fc0)

### `invalid_items`

> [tab] User message
>
> This page does not exist. Reach out to \[Company name] for help.

> [tab] Error details
>
> Reason: invalid custom items

> [tab] Common causes
>
> * [Direct login](https://docs.argyle.com/workflows/account-connections.md#direct-login) was used for an Item that does not exist.
> * Link search was constrained to Items that do not exist.
> * Link was initialized with the optional `items` [initialization parameter](https://docs.argyle.com/link/initialization/overview.md#optional-initialization-parameters) but an empty array was present.

> [tab] Troubleshooting
>
> Use the Items endpoint and Console's [Coverage](https://console.argyle.com/coverage) page to check Item availability.

![invalid\_items Link error](https://mintcdn.com/argyle/lpddaw6ggr_B1oHD/images/argyle-guides/link/error-codes/9-invalid-items.png?fit=max\&auto=format\&n=lpddaw6ggr_B1oHD\&q=85\&s=2725968c93db08f171343bfd009a1d2e)

### `invalid_user_token`

> [tab] User message
>
> The service is experiencing connection problems. Please try again later.

> [tab] Error details
>
> Reason: invalid userToken

> [tab] Common causes
>
> The [user token](https://docs.argyle.com/link/user-tokens.md) provided in the Link initialization was not valid.

> [tab] Troubleshooting
>
> Check the user token was provided correctly in the Link initialization. See our [user tokens guide](https://docs.argyle.com/link/user-tokens.md) for more information.

![invalid\_user\_token Link error](https://mintcdn.com/argyle/0Z2zBY-iD5Q5BvPN/images/argyle-guides/link/error-codes/11-invalid-user-token.png?fit=max\&auto=format\&n=0Z2zBY-iD5Q5BvPN\&q=85\&s=a9215360f8038f8161491ea1477b90c7)
