# Empty search does not return descriptive message

**URL:** <https://meta.discourse.org/t/empty-search-does-not-return-descriptive-message/168699>\
**Category:** Development\
**Created:** [October 30, 2020, 12:21am UTC](https://meta.discourse.org/t/empty-search-does-not-return-descriptive-message/168699 "2020-10-30T00:21:14Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![heyallan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heyallan/32/198583_2.png) [@heyallan](https://meta.discourse.org/u/heyallan)\
**Post date:** [October 30, 2020, 12:21am UTC](https://meta.discourse.org/t/empty-search-does-not-return-descriptive-message/168699/1 "2020-10-30T00:21:14Z")

</div>

The Front-End does not allow empty search and displays a helpful message explaining the search term is too short.

However, the API endpoint still allows empty search but the response is a JSON object with a NULL value and 200 status.

Shouldn’t the API respond with a descriptive error message and a 400 status?

**Expected:**

```json
// 400 error
{
  "errors": ["You supplied invalid parameters to the request: q"],
  "error_type": "invalid_parameters"
}

```

**Actual:**

```json
// 200 ok
{
  "grouped_search_result": null
}

```

---

_[View the full topic](https://meta.discourse.org/t/empty-search-does-not-return-descriptive-message/168699)._
