# Making api call for listing watcher with callWithInternalUser

**URL:** <https://discuss.elastic.co/t/making-api-call-for-listing-watcher-with-callwithinternaluser/157760>\
**Category:** Elasticsearch\
**Created:** [November 21, 2018, 5:31pm UTC](https://discuss.elastic.co/t/making-api-call-for-listing-watcher-with-callwithinternaluser/157760 "2018-11-21T17:31:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PradeepDS](https://avatars.discourse-cdn.com/v4/letter/p/fbc32d/32.png) [@PradeepDS](https://discuss.elastic.co/u/PradeepDS)\
**Post date:** [November 21, 2018, 5:31pm UTC](https://discuss.elastic.co/t/making-api-call-for-listing-watcher-with-callwithinternaluser/157760/1 "2018-11-21T17:31:30Z")

</div>

How to make an api call to list watcher detail using callWithInternalUser as the logged in user  
manage\_watcher will be disabled.

I have tried the below logic but getting invalid api error.  
i also tried calling watcher.get request even its invalid api.  
Any inputs on this ?

const { callWithInternalUser } = server.plugins.elasticsearch.getCluster('admin');

```
  callWithInternalUser('/api/watcher/watch', {
    id: request.params.id,
  }).then((hit) => {
    console.log('trying to get data as internal user');
    console.log(hit);
  });
```

---

<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:** [December 19, 2018, 5:31pm UTC](https://discuss.elastic.co/t/making-api-call-for-listing-watcher-with-callwithinternaluser/157760/2 "2018-12-19T17:31:50Z")

</div>

Closed on December 19, 2018, 5:31pm UTC

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