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

# Errors

> Troubleshooting has never been easier than with this guide.

ROOTKey API returns human readable error messages and a link to the docs to help you deal with that bug much faster.

Here is how an error response looks like:

```JSON theme={null}
{
  "error": {
    "message": "Incorrect credentials",
    "errorCode": "invalid-credentials",
	  "timestamp": "2024-05-19T16:24:37.884Z",
    "docUrl": "https://docs.rootkey.ai/api-reference/errors#invalid-credentials",
  }
}
```

# HTTP Codes

Give a look to the list of all errors our API returns:

### `Not Found`

* **Status:** 400
* **Problem:**
* **Solution:** Check the request and make sure it is properly formatted.

### `Unauthorized`

* **Status:** 401
* **Problem:**
* **Solution:** Check the request and make sure it is properly formatted.

### `Forbidden`

* **Status:** 403
* **Problem:**
* **Solution:** Check the request and make sure it is properly formatted.

### `Not Found`

* **Status:** 403
* **Problem:**
* **Solution:** Check the request and make sure it is properly formatted.

### `Internal Error`

* **Status:** 500
* **Problem:**
* **Solution:** Check the request and make sure it is properly formatted.

# ROOTKey Error Codes

### `invalid_email`

* **Status:** 400
* **Problem:** The email is invalid
* **Solution:** Check if the email address is properly formatted and only includes [allowed characters](https://en.wikipedia.org/wiki/Email_address#Local-part).

### `invalid_code`

* **Status:** 400
* **Problem:** The secure code provided is invalid!
* **Solution:** Make sure the code you provide is the same as the one sent to your email address!

### `inactive_account`

* **Status:** 400
* **Problem:** The user account has not been activated!
* **Solution:** Activate the user account by accessing your email and navigating to the link sent to your email for this purpose!

### `invalid_credentials`

* **Status:** 400
* **Problem:** The credentials provided are invalid!
* **Solution:** Make sure that the e-mail and password are the same as the ones you used to create a ROOTKey account!

### `invalid_title`

* **Status:** 400
* **Problem:** The title submmited is invalid and does not meet with our guidelines.
* **Solution:** Make sure that the title is between 4 and 200 characters long.

### `invalid_password`

* **Status:** 400
* **Problem:** The password submmited is invalid and does not meet with our guidelines.
* **Solution:** Make sure that the password is between 6 and 100 characters long.

### `invalid_private_key`

* **Status:** 400
* **Problem:** The private key submmited is invalid!
* **Solution:** The private key must be associated with an existing wallet in the polygon blockchain and must follow the correct scheme. For more information check our [concepts page](docs.rootkey.ai/concepts#private-key)

### `invalid_wallet_address`

* **Status:** 400
* **Problem:** The wallet address submmited is invalid!
* **Solution:** The wallet address must be associated with an existing wallet in the polygon's blockchain and must consist of 42 characters.

### `invalid_subscription`

* **Status:** 400
* **Problem:** The product subscription is invalid.
* **Solution:** A product subscription is required. Ensure that the product subscription is provided and valid.

### `max_resource_limit`

* **Status:** 400
* **Problem:** You have reached the monthly limit of this resource for your subscription.
* **Solution:** Upgrade your subscription to the next level or contact our team to define a customized plan for your needs.

### `resource_not_found`

* **Status:** 400
* **Problem:** The resource specified by the submitted ID does not exist.
* **Solution:** Ensure that the identifier provided is in the list of resources owned by your account.

### `unsubmitted_file`

* **Status:** 400
* **Problem:** The file needed to complete the desired action was not submitted.
* **Solution:** Make sure that you are attaching the file required for the desired action and that the argument is well specified. <br />In addition, make sure you have set the `multipart/form-data` header correctly.

### `code_expired`

* **Status:** 400
* **Problem:** The secure code provided has expired!
* **Solution:** Request a new code from our app.

### `default_api_key_deletion_forbidden`

* **Status:** 400
* **Problem:** The default API key cannot be deleted.
* **Solution:** Ensure that you are not attempting to delete the default API key. If you need to manage API keys, consider creating and setting a new default key instead.

### `already_default_api_key`

* **Status:** 400
* **Problem:** The API key is already set as the default key.
* **Solution:** Ensure that you are not attempting to set an API key as the default if it is already the default key. If you need to change the default key, select a different API key.

# Blockchain Error Codes

### `invalid_balance_parameter`

* **Status:** 400
* **Problem:** The balance received as parameter, is invalid
* **Solution:** Make sure that the value provided is a number and greater than 0

### `insufficient_balance`

* **Status:** 400
* **Problem:** The balance received as parameter, is invalid
* **Solution:** Upgrade your subscription to the next level or contact our team to define a customized plan for your needs.

### `smart_contract_exception`

* **Status:** 400
* **Problem:** An error occurred on the blockchain side of the operation.
* **Solution:** Ensure that all provided values are correct and comply with the requirements.

### `invalid_file_hash_format`

* **Status:** 400
* **Problem:** The submitted file hash has an invalid format!
* **Solution:** Check if the hash is correctly formatted, contains 64 characters in length and includes only hexadecimal characters

### `invalid_token_id`

* **Status:** 400
* **Problem:** The provided token ID is invalid!
* **Solution:** Make sure the token ID exists, is valid and is not empty.
