> For the complete documentation index, see [llms.txt](https://xpansionchain-1.gitbook.io/xpansionchain/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xpansionchain-1.gitbook.io/xpansionchain/troubleshooting/api/error-codes.md).

# error codes

### contract\_already\_exists[​](https://docs.x.immutable.com/docs/x/error-codes#contract_already_exists) <a href="#contract_already_exists" id="contract_already_exists"></a>

The collection has already been registered. A collection can only be registered once. Check that the value of the `contract_address` field passed to the <mark style="color:blue;">register collection API</mark> is correct.

If you have previously registered a collection and want to update some of its details, view the <mark style="color:blue;">update collection API</mark> documentation.

### missing\_metadata\_key[​](https://docs.x.immutable.com/docs/x/error-codes#missing_metadata_key) <a href="#missing_metadata_key" id="missing_metadata_key"></a>

At least one *required* metadata key was not provided in the request. The `message` field of the error response specifies the specific metadata key(s) that are missing. Example:

```
{
  "code": "missing_metadata_key",
  "message": "Missing required metadata key: name"
}
```

### metadata\_key\_already\_exists[​](https://docs.x.immutable.com/docs/x/error-codes#metadata_key_already_exists) <a href="#metadata_key_already_exists" id="metadata_key_already_exists"></a>

The metadata you are trying to add to a collection is already present. To update collection metadata, view the <mark style="color:blue;">update collection metadata API</mark>.

### mint\_validation\_failed[​](https://docs.x.immutable.com/docs/x/error-codes#mint_validation_failed) <a href="#mint_validation_failed" id="mint_validation_failed"></a>

The mint request payload has failed validation. The `message` field has more details on the validation error.

### asset\_invalid\_id[​](https://docs.x.immutable.com/docs/x/error-codes#asset_invalid_id) <a href="#asset_invalid_id" id="asset_invalid_id"></a>

`/assets/{address}/{id}` - Contract address and token id is a unique composite key.\
The contract address is not a hex (e.g.'0x02311ab2...') or the token id is not an integer. Both params stored in DB as a varchars.

### asset\_not\_found[​](https://docs.x.immutable.com/docs/x/error-codes#asset_not_found) <a href="#asset_not_found" id="asset_not_found"></a>

`/assets/{address}/{id}` - Contract address and token id is a unique composite key. The assets with such ID was not found in database (join of imx\_nft + imx\_collection + imx\_royalty)

### asset\_invalid\_format[​](https://docs.x.immutable.com/docs/x/error-codes#asset_invalid_format) <a href="#asset_invalid_format" id="asset_invalid_format"></a>

The response from DB `[]store.Asset` could not be transformed into `[]api.Asset`

### invalid\_mint\_id[​](https://docs.x.immutable.com/docs/x/error-codes#invalid_mint_id) <a href="#invalid_mint_id" id="invalid_mint_id"></a>

The provided mint `id` is invalid. It was either not correctly provided as a valid integer, or there was some other issue parsing the `id`, e.g. integer overflow, negative integer.

### mint\_not\_found[​](https://docs.x.immutable.com/docs/x/error-codes#mint_not_found) <a href="#mint_not_found" id="mint_not_found"></a>

The provided mint `id` is valid, however it does not exist. Please ensure that you are providing the `id` of a minted token.

### mint\_unwithdrawable[​](https://docs.x.immutable.com/docs/x/error-codes#mint_unwithdrawable) <a href="#mint_unwithdrawable" id="mint_unwithdrawable"></a>

The token attempting to be minted did not pass the validation to ensure it can be withdrawn on the L1 layer at a later stage. This is usually caused by a mismatch between the token ID/blueprint and your smart contracts `mintFor` logic.

This error will log log the token address, id and blueprint of the attempted mint.

### unique\_project\_error[​](https://docs.x.immutable.com/docs/x/error-codes#unique_project_error) <a href="#unique_project_error" id="unique_project_error"></a>

The provided request object contains collection addresses that belong to different projects. Ensuring that the collection addresses provided belong to the same project will solve this error.

### mint\_limit\_exceeded[​](https://docs.x.immutable.com/docs/x/error-codes#mint_limit_exceeded) <a href="#mint_limit_exceeded" id="mint_limit_exceeded"></a>

The request to mint is in danger of exceeding the allowable number of mints per project in the given timeframe. In order to increase project limits, contact the customer support team.

### collection\_limit\_exceeded[​](https://docs.x.immutable.com/docs/x/error-codes#collection_limit_exceeded) <a href="#collection_limit_exceeded" id="collection_limit_exceeded"></a>

The request to create a collection is in danger of exceeding the allowable number of collections per project created in the given timeframe. In order to increase project limits, contact the customer support team.
