> ## 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

> Use Glider error codes to identify and correct API failures.

Glider APIs return a code for each error. Use the code to identify the cause
and select the correct response.

## Platform API error codes

The Platform API uses the `API_XXX` format. The `XXX` part is a number. The
following sections group the codes by category.

### 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                                                                                                   |
| API\_007 | IDEMPOTENCY\_IN\_PROGRESS  | A request with this idempotency anchor is still being processed                                                                        |
| API\_008 | IDEMPOTENCY\_KEY\_CONFLICT | The same idempotency anchor was reused with a different request body                                                                   |

### 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         |
| API\_210 | INSUFFICIENT\_BALANCE                                | A portfolio does not have enough of a requested asset            |
| API\_211 | INVALID\_RECIPIENT                                   | The withdrawal recipient is invalid                              |
| API\_212 | DUPLICATE\_WITHDRAW\_ASSET                           | A withdrawal repeats the same asset                              |
| API\_213 | WITHDRAWAL\_CHAIN\_MISMATCH                          | Withdrawal assets and recipient are not on the same chain        |
| API\_214 | WITHDRAWAL\_PORTFOLIO\_MISMATCH                      | The signed portfolio ID does not match the route                 |
| API\_215 | PORTFOLIO\_HAS\_NO\_VAULT\_ON\_CHAIN                 | The portfolio has no smart account on the requested chain        |
| API\_216 | WITHDRAWAL\_AUTHORIZATION\_EXPIRED                   | The signed withdrawal authorization has expired                  |
| API\_217 | INVALID\_WITHDRAWAL\_SIGNATURE                       | The withdrawal signature does not match the portfolio owner      |
| API\_218 | UNSUPPORTED\_WITHDRAW\_ASSET                         | The requested asset cannot be withdrawn through this flow        |
| API\_219 | WITHDRAW\_AS\_USDC\_UNSUPPORTED\_CHAIN               | USDC settlement is not supported on the requested chain          |
| API\_220 | NOTHING\_TO\_LIQUIDATE                               | The portfolio has no eligible non-settlement assets to liquidate |
| API\_221 | UNSUPPORTED\_SETTLEMENT\_ASSET                       | The requested liquidation settlement asset is not supported      |

### 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                  |
| API\_309 | INVALID\_FLOW\_ID                | The enrollment flow identifier is invalid or expired |

### 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               |
| API\_410 | MISSING\_KERNEL\_ACCOUNT\_INDEX | A required smart-account index is missing |

### 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                   |
| API\_506 | SIGNATURE\_VERIFIER\_UNAVAILABLE | Signature verification is temporarily unavailable |

### 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 the `KMS_XXX` format. The `XXX` part is a number. The
following sections group the codes by category.

### 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       |
| KMS\_203 | AUTHENTICATION\_FAILED | KMS service authentication failed             |

### 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                                   |
| KMS\_306 | SOLANA\_UNSUPPORTED\_ON\_AZURE | The requested Solana operation is unavailable through the Azure provider |

### 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 formats

<Note>
  Legacy V1 and the B2B API use different envelopes. The first format below
  applies to V1. The B2B API puts tracing identifiers in the response headers.
  When present, `error.details` is always a `string[]`.
</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               |

### B2B API 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 the response headers. The B2B
API does not put tracing identifiers in the body.

### tRPC domain error data

tRPC clients receive the standard transport code in `error.data.code`. When a
procedure throws a typed application error, `error.data.domainCode` is also
present and carries the stable domain-specific code, for example
`SOLANA_SVM_SLOT_EXPIRED`.

`domainCode` is additive and optional. Clients should branch on it when
present, fall back to the tRPC transport code otherwise, and treat
`error.message` as human-readable text rather than a machine identifier.

### B2B API enrollment conditions

Solana enrollment uses these existing codes:

* `API_104` (403) also means that Solana enrollment is not enabled for the
  tenant. The tenant can lack the entitlement or the deployment can lack the
  SVM service.
* `API_400` (400) can mean that one request contains Solana and EVM
  `chainIds`. Use one namespace in each enrollment request.

## Handle errors

1. Read `error.code` to identify the error.
2. Use `error.message` in logs or user messages.
3. Include the correlation ID and request ID in a support request.
4. For validation errors, read `error.details`.
5. For tRPC errors, prefer `error.data.domainCode` when it is present.
