# Errors

The Solaris API uses standard HTTP response codes to indicate the success or failure of a request.

* **2xx:** Success.
* **4xx:** Client Error (e.g., missing parameters, validation failed, invalid token).
* **5xx:** Server Error (something went wrong on the Solaris platform).


## Error response format

Solaris error responses follow a standard JSON format. The response body contains an `errors` array, allowing multiple errors to be returned for a single request (e.g., multiple validation failures).

### Response attributes

| Attribute | Type | Description |
|  --- | --- | --- |
| `id` | string | **Unique Error ID.** Include this ID when contacting Solaris Support. |
| `status` | integer | The HTTP status code (e.g., `400`). |
| `code` | string | Machine-readable error code (e.g., `invalid_model`). |
| `title` | string | Human-readable generic error title. |
| `detail` | string | Specific details about what went wrong. |
| `source` | object | (Optional) Identifies the specific field that caused the error. Contains `field` and `message`. |


### Example error response (400 Bad Request)


```json
{
    "errors": [
        {
            "id": "84b61fb9bf2117b3653a91ba9fc18d8bex",
            "status": 400,
            "code": "invalid_model",
            "title": "Invalid Model",
            "detail": "employment_status is not included in the list...",
            "source": {
                "field": "employment_status",
                "message": "is not included in the list..."
            }
        }
    ]
}
```

## Common error codes

### 400 Bad Request

| JSON Code | Title | Description |
|  --- | --- | --- |
| `invalid_model` | Invalid Model | A parameter failed validation constraints (e.g., blank, too long). |
| `invalid_webhook_url` | Invalid Webhook URL | The provided URL returned a non-200 status during verification. |
| `unsafe_webhook_url` | Unsafe Webhook URL | The URL is not HTTPS. |
| `validation_error` | Validation Error | General validation failure. |
| `type_error` | Type Error | A parameter had the wrong data type (e.g., String instead of Integer). |
| `invalid_json` | Invalid JSON | The request body was not properly formatted JSON. |


### 401 Unauthorized / 403 Forbidden

| JSON Code | Title | Description |
|  --- | --- | --- |
| `invalid_token` | Invalid Token | The Access Token is expired or malformed. |
| `token_required` | Token Required | No `Authorization` header was provided. |
| `unauthorized_partner` | Unauthorized Partner | Your partner account is not permitted to access this resource. |
| `unauthorized_action` | Unauthorized Action | Your token scopes do not allow this specific HTTP method. |
| `authorization_required` | Authorization Required | The action requires a Change Request authorization (SCA). |
| `invalid_tan` | Invalid TAN | The SMS OTP or Device Signature was incorrect. |


### 404 Not Found / 409 Conflict

| JSON Code | Title | Description |
|  --- | --- | --- |
| `model_not_found` | Model Not Found | The requested resource ID does not exist. |
| `record_not_unique` | Record Not Unique | A unique constraint was violated (e.g., mobile number already exists). |


### 5xx Server Errors

| JSON Code | Title | Description |
|  --- | --- | --- |
| `generic_error` | Generic Error | Internal server error. Please retry or contact support. |
| `not_implemented_error` | Not Implemented | This endpoint is not yet available. |
| `bad_gateway` | Bad Gateway | Upstream error. |
| `gateway_timeout` | Gateway Timeout | The request took too long to process. |


## Requesting support

If you encounter persistent errors, please [contact Solaris Support](/help/). To ensure a fast resolution, ensure you include the following:

1. **The Error ID:** Found in the `id` field of the error response.
2. **The Endpoint:** The URL and HTTP method you called.
3. **Timestamp:** When the error occurred.


Log Retention
Solaris stores request logs for **30 days**. Please report issues promptly. Note that for security reasons, Solaris **does not** store the request payload (body) in the logs.