# How to get sql rest api working from kibana?

**URL:** <https://discuss.elastic.co/t/how-to-get-sql-rest-api-working-from-kibana/128954>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-sql\
**Created:** [April 21, 2018, 5:21am UTC](https://discuss.elastic.co/t/how-to-get-sql-rest-api-working-from-kibana/128954 "2018-04-21T05:21:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dalinqin](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@dalinqin](https://discuss.elastic.co/u/dalinqin)\
**Post date:** [April 21, 2018, 5:21am UTC](https://discuss.elastic.co/t/how-to-get-sql-rest-api-working-from-kibana/128954/1 "2018-04-21T05:21:11Z")

</div>

Hello everyone ,

i'm trying with [sql rest api](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/sql-rest.html)  
my elasticsearch version is 6.2.4.  
after installed xpack for both es and kibana ,i tried the following command from kibana dev tools, it give me the error below .  
Also i didn't see **sql-cli** in bin/x-pack folder ,i installed x-pack by `bin/elasticsearch-plugin install x-pack` command , did I miss anything ?any suggestion would be appreciate.thanks.

```
POST /_xpack/sql?format=txt
{
    "query": "SELECT * FROM library ORDER BY page_count DESC LIMIT 5"
}

```

> {  
> "error": {  
> "root\_cause": [  
> {  
> "type": "invalid\_index\_name\_exception",  
> "reason": "Invalid index name [_xpack], must not start with '_', '-', or '+'",  
> "index\_uuid": "_na_",  
> "index": "\_xpack"  
> }  
> ],  
> "type": "invalid\_index\_name\_exception",  
> "reason": "Invalid index name [_xpack], must not start with '_', '-', or '+'",  
> "index\_uuid": "_na_",  
> "index": "\_xpack"  
> },  
> "status": 400  
> }

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [April 21, 2018, 5:53am UTC](https://discuss.elastic.co/t/how-to-get-sql-rest-api-working-from-kibana/128954/2 "2018-04-21T05:53:04Z")

</div>

The SQL API is not available in 6.2.  
If you check the top of the doc you linked to, it says

> You are looking at preliminary documentation for a future release

SQL is planned for release as part of 6.3

---

<div class="post-metadata">

**Author:** ![dalinqin](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@dalinqin](https://discuss.elastic.co/u/dalinqin)\
**Post date:** [April 21, 2018, 6:10am UTC](https://discuss.elastic.co/t/how-to-get-sql-rest-api-working-from-kibana/128954/3 "2018-04-21T06:10:13Z")

</div>

thank you Tim, that's explained everything 😁

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 19, 2018, 6:10am UTC](https://discuss.elastic.co/t/how-to-get-sql-rest-api-working-from-kibana/128954/4 "2018-05-19T06:10:26Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
