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

# Error Codes Reference

> A comprehensive list of error codes returned by Glider APIs

# Error Codes Reference

This page contains a comprehensive list of error codes returned by Glider APIs. Understanding these error codes can help with troubleshooting and implementing better error handling in your applications.

## Platform API Error Codes

The Platform API uses error codes in the format `API_XXX`, where `XXX` is a numerical code. Errors are grouped into categories:

### General Errors (000-099)

| Code     | Name                  | Description                                                                                                                            |
| -------- | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| API\_000 | UNKNOWN\_ERROR        | An unknown error occurred                                                                                                              |
| API\_001 | CONFIGURATION\_ERROR  | Missing or invalid configuration                                                                                                       |
| API\_002 | INVALID\_REQUEST      | The request is invalid or malformed                                                                                                    |
| API\_003 | METHOD\_NOT\_ALLOWED  | The HTTP method is not allowed for this endpoint                                                                                       |
| API\_004 | RATE\_LIMIT\_EXCEEDED | Rate limit has been exceeded. See the [Rate Limiting guide](/guides/rate-limiting) for details on tiers, headers, and retry strategies |
| API\_005 | FEATURE\_UNAVAILABLE  | The requested feature is not available                                                                                                 |
| API\_006 | NOT\_FOUND            | The requested resource was not found                                                                                                   |

### Authentication and Authorization Errors (100-199)

| Code     | Name               | Description                                        |
| -------- | ------------------ | -------------------------------------------------- |
| API\_100 | UNAUTHORIZED       | Authentication is required to access this resource |
| API\_101 | API\_KEY\_MISSING  | API key is required but was not provided           |
| API\_102 | API\_KEY\_INVALID  | The provided API key is invalid                    |
| API\_103 | API\_KEY\_EXPIRED  | The provided API key has expired                   |
| API\_104 | PERMISSION\_DENIED | Permission denied to perform the operation         |
| API\_105 | TENANT\_NOT\_FOUND | The requested tenant was not found                 |
| API\_106 | TENANT\_DISABLED   | The tenant account is disabled                     |
| API\_107 | USER\_NOT\_FOUND   | The requested user was not found                   |
| API\_108 | TOKEN\_EXPIRED     | The authentication token has expired               |
| API\_109 | TOKEN\_INVALID     | The authentication token is invalid                |
| API\_110 | FORBIDDEN\_ACTION  | The requested action is forbidden                  |

### Portfolio Specific Errors (200-299)

| Code     | Name                                                 | Description                                              |
| -------- | ---------------------------------------------------- | -------------------------------------------------------- |
| API\_200 | PORTFOLIO\_NOT\_FOUND                                | The requested portfolio was not found                    |
| API\_201 | PORTFOLIO\_CREATE\_FAILED                            | Failed to create portfolio                               |
| API\_202 | PORTFOLIO\_ALREADY\_EXISTS                           | A portfolio with this identifier already exists          |
| API\_203 | PORTFOLIO\_UPDATE\_FAILED                            | Failed to update portfolio                               |
| API\_204 | PORTFOLIO\_DELETE\_FAILED                            | Failed to delete portfolio                               |
| API\_205 | PORTFOLIO\_LIMIT\_REACHED                            | Portfolio limit has been reached                         |
| API\_206 | PORTFOLIO\_TEMPLATE\_NOT\_FOUND                      | The requested portfolio template was not found           |
| API\_207 | PORTFOLIO\_TEMPLATE\_VALIDATION\_ERROR               | The portfolio template failed validation                 |
| API\_208 | PORTFOLIO\_SESSION\_KEY\_MISSING                     | Session key is missing for portfolio operations          |
| API\_209 | PORTFOLIO\_RESIGN\_REQUIRED\_\_INVALID\_SESSION\_KEY | Portfolio requires re-signing due to invalid session key |

### Signature and Cryptographic Errors (300-399)

| Code     | Name                             | Description                                   |
| -------- | -------------------------------- | --------------------------------------------- |
| API\_300 | SIGNATURE\_MISSING               | Signature is required but was not provided    |
| API\_301 | SIGNATURE\_INVALID               | The provided signature is invalid             |
| API\_302 | SIGNATURE\_VERIFICATION\_FAILED  | Failed to verify the provided signature       |
| API\_303 | SESSION\_KEY\_GENERATION\_FAILED | Failed to generate session key                |
| API\_304 | MESSAGE\_GENERATION\_FAILED      | Failed to generate message for signing        |
| API\_305 | WALLET\_CONNECTION\_FAILED       | Failed to connect to wallet                   |
| API\_306 | INVALID\_MESSAGE                 | The message format is invalid for signing     |
| API\_307 | MESSAGE\_RECOVERY\_FAILED        | Failed to recover address from signed message |
| API\_308 | MISSING\_MESSAGE\_FIELD          | Required field missing from message           |

### Validation Errors (400-499)

| Code     | Name                         | Description                          |
| -------- | ---------------------------- | ------------------------------------ |
| API\_400 | VALIDATION\_ERROR            | Input validation failed              |
| API\_401 | INVALID\_ADDRESS             | Invalid address format               |
| API\_402 | INVALID\_CHAIN\_ID           | Invalid chain ID                     |
| API\_403 | CHAIN\_NOT\_SUPPORTED        | The specified chain is not supported |
| API\_404 | INVALID\_KERNEL\_VERSION     | Invalid kernel version               |
| API\_405 | INVALID\_PERMISSIONS         | Invalid permissions format           |
| API\_406 | MISSING\_REQUIRED\_FIELD     | Required field is missing            |
| API\_407 | INVALID\_FORMAT              | Input data has an invalid format     |
| API\_408 | INVALID\_PARAMETER           | One or more parameters are invalid   |
| API\_409 | INVALID\_USER\_ADDRESS\_CODE | Invalid user address format          |

### External Service Errors (500-599)

| Code     | Name                      | Description                              |
| -------- | ------------------------- | ---------------------------------------- |
| API\_500 | PROVIDER\_ERROR           | Error from an external provider          |
| API\_501 | PROVIDER\_UNAVAILABLE     | External provider service is unavailable |
| API\_502 | PROVIDER\_TIMEOUT         | Request to external provider timed out   |
| API\_503 | BLOCKCHAIN\_RPC\_ERROR    | Error from blockchain RPC endpoint       |
| API\_504 | EXTERNAL\_SERVICE\_ERROR  | Error from an external service           |
| API\_505 | EXTERNAL\_REQUEST\_FAILED | External service request failed          |

### Deposit and Wallet Operation Errors (550-570)

| Code     | Name                                           | Description                                    |
| -------- | ---------------------------------------------- | ---------------------------------------------- |
| API\_550 | DEPOSIT\_REQUEST\_INSUFFICIENT\_ASSET\_BALANCE | Insufficient asset balance for deposit request |
| API\_551 | TRANSACTION\_SIMULATION\_FAILED                | Transaction simulation failed                  |
| API\_552 | CANNOT\_FETCH\_NATIVE\_BALANCE                 | Failed to fetch native token balance           |
| API\_553 | CANNOT\_FETCH\_ERC20\_BALANCE                  | Failed to fetch ERC20 token balance            |
| API\_554 | MAX\_WITHDRAWAL\_PROCESSING\_ERROR             | Error processing maximum withdrawal amount     |
| API\_555 | ZERO\_BALANCE\_WITHDRAWAL\_ERROR               | Attempting to withdraw zero balance            |

### Internal Errors (600-699)

| Code     | Name                   | Description                             |
| -------- | ---------------------- | --------------------------------------- |
| API\_600 | INTERNAL\_ERROR        | Internal server error                   |
| API\_601 | DATABASE\_ERROR        | Error with database operation           |
| API\_602 | SERIALIZATION\_ERROR   | Error serializing or deserializing data |
| API\_603 | PROCESSING\_ERROR      | Error processing the request            |
| API\_604 | TRANSACTION\_FAILED    | Transaction processing failed           |
| API\_605 | DATA\_INTEGRITY\_ERROR | Data integrity violation                |
| API\_606 | CACHE\_ERROR           | Error with cache operation              |
| API\_607 | RESOURCE\_NOT\_FOUND   | Requested resource not found            |

## KMS API Error Codes

The KMS API uses error codes in the format `KMS_XXX`, where `XXX` is a numerical code. Errors are grouped into categories:

### General Errors (000-099)

| Code     | Name                 | Description                         |
| -------- | -------------------- | ----------------------------------- |
| KMS\_000 | UNKNOWN\_ERROR       | An unknown error occurred           |
| KMS\_001 | CONFIGURATION\_ERROR | Missing or invalid configuration    |
| KMS\_002 | INVALID\_REQUEST     | The request is invalid or malformed |

### Key Management Errors (100-199)

| Code     | Name                        | Description                                  |
| -------- | --------------------------- | -------------------------------------------- |
| KMS\_100 | KEY\_NOT\_FOUND             | The requested key was not found              |
| KMS\_101 | KEY\_ALREADY\_EXISTS        | A key with this identifier already exists    |
| KMS\_102 | KEY\_CREATION\_FAILED       | Failed to create key                         |
| KMS\_103 | KEY\_LENGTH\_EXCEEDED       | The key ID length exceeds the provider limit |
| KMS\_104 | KEY\_VERSION\_INVALID       | Invalid key version                          |
| KMS\_105 | KEY\_RING\_NOT\_FOUND       | The key ring was not found                   |
| KMS\_106 | KEY\_RING\_CREATION\_FAILED | Failed to create key ring                    |

### Permission Errors (200-299)

| Code     | Name               | Description                                   |
| -------- | ------------------ | --------------------------------------------- |
| KMS\_200 | PERMISSION\_DENIED | Permission denied to perform the operation    |
| KMS\_201 | UNAUTHORIZED       | Unauthorized to access the requested resource |
| KMS\_202 | ACCESS\_REVOKED    | Access to the resource has been revoked       |

### Validation Errors (300-399)

| Code     | Name                  | Description                            |
| -------- | --------------------- | -------------------------------------- |
| KMS\_300 | VALIDATION\_ERROR     | General validation error               |
| KMS\_301 | INVALID\_ADDRESS      | Invalid Ethereum address format        |
| KMS\_302 | INVALID\_STRATEGY\_ID | Invalid strategy ID format or length   |
| KMS\_303 | INVALID\_KEY\_ID      | Invalid key ID format                  |
| KMS\_304 | INVALID\_MESSAGE      | Invalid message format for signing     |
| KMS\_305 | INVALID\_TRANSACTION  | Invalid transaction format for signing |

### External Service Errors (400-499)

| Code     | Name                  | Description                                  |
| -------- | --------------------- | -------------------------------------------- |
| KMS\_400 | PROVIDER\_ERROR       | Error from the KMS provider (GCP, AWS, etc.) |
| KMS\_401 | PROVIDER\_UNAVAILABLE | KMS provider service is unavailable          |
| KMS\_402 | PROVIDER\_TIMEOUT     | Request to KMS provider timed out            |

### Internal Errors (500-599)

| Code     | Name            | Description                       |
| -------- | --------------- | --------------------------------- |
| KMS\_500 | INTERNAL\_ERROR | Internal server error             |
| KMS\_501 | DATABASE\_ERROR | Error with the database operation |
| KMS\_502 | SIGNING\_ERROR  | Error during signing operation    |

## Error Response Format

<Note>
  V1 and V2 use different envelopes. The shape below is **V1**. For V2, see
  the [V2 overview](/api-reference/v2-overview) — V2 places tracing
  identifiers in the `X-Correlation-Id` and `X-Request-Id` response headers
  instead of the body, and `error.details` is always a `string[]` (not an
  object) when present.
</Note>

### V1 envelope

```json theme={null}
{
  "success": false,
  "error": {
    "message": "Error message explaining what went wrong",
    "code": "API_XXX",
    "details": {}, // Optional additional error details
    "correlationId": "unique-correlation-id",
    "requestId": "unique-request-id",
    "timestamp": "2025-05-21T12:34:56.789Z"
  }
}
```

| Field                 | Description                                         |
| --------------------- | --------------------------------------------------- |
| `success`             | Always `false` for error responses                  |
| `error.message`       | Human-readable error description                    |
| `error.code`          | Standardized error code (e.g., `API_404`)           |
| `error.details`       | Optional object containing additional error context |
| `error.correlationId` | Unique ID for correlating errors across systems     |
| `error.requestId`     | Unique ID for the specific request                  |
| `error.timestamp`     | ISO timestamp when the error occurred               |

### V2 envelope

```json theme={null}
{
  "success": false,
  "error": {
    "code": "API_400",
    "message": "Request validation failed",
    "details": ["allocation.assets: Allocation weights must sum to 100"]
  }
}
```

| Field           | Description                                                                                                   |
| --------------- | ------------------------------------------------------------------------------------------------------------- |
| `success`       | Always `false` for error responses                                                                            |
| `error.code`    | Standardized error code (e.g., `API_400`)                                                                     |
| `error.message` | Human-readable error description                                                                              |
| `error.details` | Optional `string[]` with per-field validation messages. Omitted when there is nothing to say beyond `message` |

Read `X-Correlation-Id` and `X-Request-Id` from response headers. V2 never
places tracing identifiers inside the body.

## Handling Errors

When implementing error handling in your application:

1. Check the `error.code` to identify specific error conditions
2. Use the `error.message` for displaying to users or logging
3. Include the `correlationId` and `requestId` when reporting issues to Glider support
4. For validation errors, check the `error.details` field for specific validation failures
