# I am not able make api hit

**URL:** <https://discuss.huggingface.co/t/i-am-not-able-make-api-hit/164490>\
**Category:** Beginners\
**Created:** [July 25, 2025, 12:03pm UTC](https://discuss.huggingface.co/t/i-am-not-able-make-api-hit/164490 "2025-07-25T12:03:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Teju00001](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/teju00001/32/51694_2.png) [@Teju00001](https://discuss.huggingface.co/u/Teju00001)\
**Post date:** [July 25, 2025, 12:03pm UTC](https://discuss.huggingface.co/t/i-am-not-able-make-api-hit/164490/1 "2025-07-25T12:03:42Z")

</div>

I created a token with read write permission  
curl -H “Authorization: Bearer YOUR\_ACTUAL\_HUGGING\_FACE\_TOKEN” [https://huggingface.co/api/whoami](https://huggingface.co/api/whoami)

passed the bearer token I created

I am getting continues  
{  
“error”: “Invalid credentials in Authorization header”  
}

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [July 25, 2025, 12:18pm UTC](https://discuss.huggingface.co/t/i-am-not-able-make-api-hit/164490/2 "2025-07-25T12:18:23Z")

</div>

Try [`whoami-v2`](https://huggingface.co/docs/hub/api#get-apiwhoami-v2).
