# JupyterHub Rest API: Retrieve list of non-running named servers

**URL:** <https://discourse.jupyter.org/t/jupyterhub-rest-api-retrieve-list-of-non-running-named-servers/24174>\
**Category:** JupyterHub\
**Created:** [February 28, 2024, 3:23pm UTC](https://discourse.jupyter.org/t/jupyterhub-rest-api-retrieve-list-of-non-running-named-servers/24174 "2024-02-28T15:23:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gfg4](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@gfg4](https://discourse.jupyter.org/u/gfg4)\
**Post date:** [February 28, 2024, 3:23pm UTC](https://discourse.jupyter.org/t/jupyterhub-rest-api-retrieve-list-of-non-running-named-servers/24174/1 "2024-02-28T15:23:06Z")

</div>

Hi,

I’m trying to retrieve the list of named servers that are **not** running, but neither the `/user` nor the `/users/<name>` endpoints return this list.

These two endpoints are able to retrieve the named servers that are currently running, but I’m looking for the ones that aren’t running.

Any ideas?

Thanks

---

<div class="post-metadata">

**Author:** ![consideRatio](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/consideratio/32/1033_2.png) [@consideRatio](https://discourse.jupyter.org/u/consideRatio)\
**Post date:** [February 28, 2024, 6:15pm UTC](https://discourse.jupyter.org/t/jupyterhub-rest-api-retrieve-list-of-non-running-named-servers/24174/2 "2024-02-28T18:15:12Z")

</div>

Have a look at this for example: [kube\_orphans.py · GitHub](https://gist.github.com/minrk/e15653520847746e643a6ca5e48d3949#file-kube_orphans-py-L22) (its not what you are asking for, but similar)

And check out the REST API docs:

- usage docs at [Using JupyterHub’s REST API — JupyterHub documentation](https://jupyterhub.readthedocs.io/en/stable/howto/rest.html)
- reference docs at [JupyterHub REST API — JupyterHub documentation](https://jupyterhub.readthedocs.io/en/stable/reference/rest-api.html)

---

<div class="post-metadata">

**Author:** ![gfg4](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@gfg4](https://discourse.jupyter.org/u/gfg4)\
**Post date:** [February 29, 2024, 8:45am UTC](https://discourse.jupyter.org/t/jupyterhub-rest-api-retrieve-list-of-non-running-named-servers/24174/3 "2024-02-29T08:45:02Z")

</div>

Thanks, the `kube_orphans.py` script helped a lot. I completely missed the `include_stopped_servers ` parameter from the `/users` endpoint. I was expecting `/user` and `/users/<name>` to return all active and inactive servers
