# How do you use the whoami endpoint?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-do-you-use-the-whoami-endpoint%2F15830%3E%5C
**Category:** Beginners\
**Created:** [March 17, 2022, 10:46pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-do-you-use-the-whoami-endpoint%2F15830 "2022-03-17T22:46:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyle-mantium](https://avatars.discourse-cdn.com/v4/letter/k/c77e96/32.png) [@kyle-mantium](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fkyle-mantium)%5C
**Post date:** [March 17, 2022, 10:46pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-do-you-use-the-whoami-endpoint%2F15830%2F1 "2022-03-17T22:46:28Z")

</div>

The whoami endpoint is listed on your public facing API page here: [Hub API Endpoints](https://huggingface.co/docs/hub/endpoints)

However I cannot curl this endpoint. It always returns unauthorized.

There’s a been a stackoverflow question hanging around that matches my issue exactly, so I’ll link it here:

> <https://stackoverflow.com/questions/70932914/hugging-face-whoami-endpoint-returns-unauthorized>

Is this endpoint intended to be usable? If so, how?

My intent was to check token validity before trying to use them to run models, so that I could quickly identify bad tokens.

Thanks for any help.

---

<div class="post-metadata">

**Author:** ![osanseviero](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/osanseviero/32/38738_2.png) [@osanseviero](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fosanseviero)%5C
**Post date:** [March 18, 2022, 1:29pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-do-you-use-the-whoami-endpoint%2F15830%2F2 "2022-03-18T13:29:37Z")

</div>

Hey there! Thanks for raising!

The endpoint was updated to `whoami-v2`, it seems we missed updating that doc page. Here is a working example

```auto
curl https://huggingface.co/api/whoami-v2 -H "Authorization: Bearer your_token"

```

Note that we also have a Python library with a `whoami` method you can use if that’s useful. [huggingface\_hub/src/huggingface\_hub at main · huggingface/huggingface\_hub · GitHub](https://github.com/huggingface/huggingface_hub/tree/main/src/huggingface_hub)
