# API call for listing nodes in the "Unauthorized" state

## Problem

How to list UUIDs of PMK nodes, which are stuck in an "Unauthorized" state using resmgr API.

## Environment

* Platform9 Managed Kubernetes - v4.0 and Higher

## Procedure

To get the UUIDs of nodes in the unauthorized state, please follow the procedure below:

Step 1: **Generate Token**

Please follow the doc <https://platform9.com/docs/kubernetes/keystone-identity-api> to generate the token.

{% tabs %}
{% tab title="Bash" %}

```bash
export TOKEN=<token generated by above procedure>
```

{% endtab %}
{% endtabs %}

Step 2: **List UUIDs of** **nodes in the** **unauthorized state**

{% tabs %}
{% tab title="Bash" %}

```bash
curl -s --request GET --url <FQDN>/resmgr/v1/hosts --header "X-Auth-Token: '$TOKEN'}" | jq '.[] | select(.roles | length == 0) | .id'Environment
```

{% endtab %}
{% endtabs %}

Replace the FQDN in the above command.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://platform9.com/kb/pmk/frequently-asked-questions/api-call-for-listing-nodes-in-the--unauthorized--state.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
