# List of available endpoints/params when using callWithRequest method

**URL:** <https://discuss.elastic.co/t/list-of-available-endpoints-params-when-using-callwithrequest-method/200027>\
**Category:** Kibana\
**Created:** [September 18, 2019, 2:21pm UTC](https://discuss.elastic.co/t/list-of-available-endpoints-params-when-using-callwithrequest-method/200027 "2019-09-18T14:21:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alah64](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alah64/32/100065_2.png) [@alah64](https://discuss.elastic.co/u/alah64)\
**Post date:** [September 18, 2019, 2:21pm UTC](https://discuss.elastic.co/t/list-of-available-endpoints-params-when-using-callwithrequest-method/200027/1 "2019-09-18T14:21:53Z")

</div>

hello.  
i wrote kibana plugin and i want to use callWithRequest method and communicate with elastic , where can i find the list of available endpoints/params ?  
my code sample:

```auto
const { callWithRequest } = server.plugins.elasticsearch.getCluster('data');
    server.route({
        path: '/api/myplugin/search',
        method: 'POST',
        async handler(req,res) {
              ....
            return callWithRequest(req, 'search', {
                //SearchParams
                index: ....,
                q:....
            }).finally(r => res.response(r));
        }
    });

```

or like this :

```auto
server.route({
        path: '/api/myplugin/post',
        method: 'POST',
        async handler(req,res) {
            return callWithRequest(req, 'index', {
             // IndexDocumentParams 
            }).finally(r => res.response(r));
        }
    });

```

thanks.

---

<div class="post-metadata">

**Author:** ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)\
**Post date:** [September 18, 2019, 3:29pm UTC](https://discuss.elastic.co/t/list-of-available-endpoints-params-when-using-callwithrequest-method/200027/2 "2019-09-18T15:29:14Z")

</div>

Hey @alah64,

You can checkout the API reference here for the list of available endpoints/params: [https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html](https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html)

---

<div class="post-metadata">

**Author:** ![alah64](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alah64/32/100065_2.png) [@alah64](https://discuss.elastic.co/u/alah64)\
**Post date:** [September 18, 2019, 3:37pm UTC](https://discuss.elastic.co/t/list-of-available-endpoints-params-when-using-callwithrequest-method/200027/3 "2019-09-18T15:37:29Z")

</div>

That's what I wanted.  
Thankful

---

<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:** [October 16, 2019, 3:37pm UTC](https://discuss.elastic.co/t/list-of-available-endpoints-params-when-using-callwithrequest-method/200027/4 "2019-10-16T15:37:30Z")

</div>

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