---
title: Errors
slug: indexing-apis/errors
docTags: 
createdAt: 2024-02-09T14:02:33.748Z
---

:::hint{type="warning"}
**Merchants are responsible for ensuring the accuracy of the data they submit. This includes checking for:**

- Leading and trailing spaces included in the submitted data are considered valid and are retained during processing in our backend.
- Special characters included in the submitted data are properly escaped to ensure compatibility with JSON format.
- HTML formatting in descriptions or short descriptions is correctly escaped to prevent unintended rendering issues.
- The startPrice and toPrice are calculated only when not explicitly submitted for all variants within a given complex product.
:::

At Klevu.com, we utilize conventional HTTP response codes to convey the outcome of API requests.&#x20;

- Responses in the **2xx** range signify successful operations.
- Responses in the **4xx** range denote errors stemming from the provided information, such as missing required parameters or failed requests.
- Responses in the **5xx** range signify issues with Klevu's servers, though these are uncommon.

```json
{
    "status": {{http_status_code}},
    "code": "{{error_code}}",
    "message": "{{human readable message}}",
    "debug": [
        {"id":"{{optional_document_id}}","message":"{{detailed message that helps to debug the error.}}"}
    ]
}
```

### Understanding the error response:

| **Parameters** | **Description**                                                                                                                                   |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| status         | HTTP status codes: 400,401, 405, 413, 415, 500, 502, 503, 504                                                                                     |
| code           | The type of error returned. please see below reference table below for more information.                                                          |
| message        | A brief overview of the error.                                                                                                                    |
| debug          | A comprehensive breakdown of the error, highlighting the reason for the issue along with specific details regarding the record causing the error. |

### Error Message Illustrations:&#x20;

| **status**       | **code**                 | **message**                                                                       | **debug**                                                                                                                                                                                                                                                                                                                        |
| ---------------- | ------------------------ | --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 400              | VALIDATION\_ERROR        | The request was invalid. Please check the provided payload for errors.            | \[  \{"id":"1233AD","message":"Attribute: brand is undefined."}<br />]                                                                                                                                                                                                                                                           |
| 400              | INVALID\_REQUEST         | The request was invalid. Please check the provided payload for errors.            | \[<br />\{<br />"message": "The store is currently configured to use XML Data Indexing APIs. Before you can begin using the new JSON endpoint, a backend migration is required. Please submit a support ticket at https\://help.klevu.com/support/tickets/new to request assistance with the backend migration process."}<br />] |
| 401              | AUTHENTICATION\_ERROR    | Authentication failed. Please ensure your credentials are valid and try again.    | \[\{"message":"The supplied credentials are invalid."}<br />]                                                                                                                                                                                                                                                                    |
| 405              | METHOD\_NOT\_ALLOWED     | The request method is not allowed.                                                | \[ \{"message":"Please ensure you are using a valid request method for this endpoint. The allowed methods are GET/POST/DELETE."}<br />]                                                                                                                                                                                          |
| 413              | CONTENT\_TOO\_LARGE      | The batch content in the request exceeds the allowable size limit for processing. | \[\{"message" : "The request content is too large. The maximum allowed size is 2MB."}]                                                                                                                                                                                                                                           |
| 415              | UNSUPPORTED\_MEDIA\_TYPE | The request Content-Type is not allowed.                                          | \[ \{"message": "The request header Content-Type: text/plain is not supported for this endpoint."  }]                                                                                                                                                                                                                            |
| 500/502/ 503/504 | SERVER\_ERROR            | Something went wrong on Klevu’s end.                                              | \[\{"message":"Something went wrong on Klevu’s end. Please contact Klevu support at https\://help.klevu.com/support/tickets/new" }]                                                                                                                                                                                              |





