# Responses

The API responds with `Content-Type` set to `application/json` and JSON content. In case of success, the HTTP status code is 200 and the content contains results according to the particular operation. In case of error, different HTTP status codes are used for different types of error:

* **400 Bad Request**
  * Error caused by the client application, e.g. in case of a malformed request or invalid identifier of a resource. In most cases, such an error signifies an error in the client application, i.e. the consumer of the API.
* **401 Unauthorized**
  * Error caused by usage of an invalid access token.
* **403 Forbidden**
  * Server error that should be reported to the end user of the client application. This happens, for example, when the server-side validation fails or when a business-logic check is violated.
* **429 Too Many Requests**
  * Error indicating that the user has sent too many requests in a given amount of time. Response contains `Retry-After` header indicating how long the user agent should wait before making a follow-up request. For more information, see [Request limits](/booking-engine-guide/booking-engine-api/guidelines/requests.md#request-limits).
* **500 Internal Server Error**
  * Unexpectced error of the server. In most cases, such an error signifies an error on the Mews side. This will be logged and we will be notified immediately when such an error occurs. If anything like this happens, please contact Mews directly or raise an issue on GitHub.

In case of any error, the returned JSON object describes the error and has the following properties:

| Property  | Type   | Contract | Description                                                                                                                                |
| --------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `Message` | string | required | Description of the error                                                                                                                   |
| `Details` | string | optional | Additional details about the error, e.g. request, headers, server stack trace, inner exceptions; only available on Development environment |

Some errors may contain further information relevant to the error on top of these two properties, but that depends on the operation and is specifically described in the operation documentation.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mews.com/booking-engine-guide/booking-engine-api/guidelines/responses.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
