# Data API Error Handling

On successful processing of SingleStore's Data API requests, the server returns the *200 OK* HTTP status line. On Data API request failure, the server returns a status code for the error along with a message describing the issue. The error messages are returned as bare strings in the response body.

The following table provides a list of HTTP response status codes that are used for handling errors in SingleStore’s Data API requests.

| HTTP Status Code          | Description                                                                                                                                                                                                                                                                                                                            |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 400 Bad Request           | A general error code used for client request issues for reasons, such as:<ul> <li>Request body is not JSON</li> <li>Request body does not match the input schema</li> <li>SQL is malformed</li> <li>Context database does not exist</li> </ul>                                                                                         |
| 401 Unauthorized          | <ul> <li>Invalid authentication credentials</li> <li>Authentication failed</li> </ul>When using JWTs to authenticate, this error code may indicate the following issues:<ul> <li>The specified JWT is invalid</li> <li>Invalid JWT signature, i.e., the JWT signature cannot be verified using JWKS fetched from the engine</li> </ul> |
| 403 Forbidden             | Authorization error from SingleStore                                                                                                                                                                                                                                                                                                   |
| 404 Not Found             | Path not found                                                                                                                                                                                                                                                                                                                         |
| 405 Method Not Allowed    | Incorrect HTTP method used for the endpoint specified                                                                                                                                                                                                                                                                                  |
| 408 Request Timeout       | Timeout while waiting for the client to provide a complete request with the headers and the JSON body                                                                                                                                                                                                                                  |
| 500 Internal Server Error | A general error code used to handle many different error conditions and are generally considered unexpected. For example, you might receive this error if some of your data partitions are offline during a query or if the HTTP service is unable to communicate with the underlying SingleStore node.                                |
| 504 Gateway Timeout       | Timeout while communicating with the underlying SingleStore node                                                                                                                                                                                                                                                                       |

***

Modified at: January 25, 2023

Source: [/db/v9.1/reference/data-api/data-api-error-handling/](https://docs.singlestore.com/db/v9.1/reference/data-api/data-api-error-handling/)

(An index of the documentation is available at /llms.txt)
