# Serverless project APIs returning 401's

**URL:** <https://discuss.elastic.co/t/serverless-project-apis-returning-401s/381402>\
**Category:** Elasticsearch\
**Created:** [August 27, 2025, 7:24pm UTC](https://discuss.elastic.co/t/serverless-project-apis-returning-401s/381402 "2025-08-27T19:24:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![danN](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@danN](https://discuss.elastic.co/u/danN)\
**Post date:** [August 27, 2025, 7:24pm UTC](https://discuss.elastic.co/t/serverless-project-apis-returning-401s/381402/1 "2025-08-27T19:24:41Z")

</div>

Hello,

I created a serverless project in elastic the other day as I wanted to run some API queries. I then clicked on the ? icon in the top right of my portal and selected “Connection Details”, copied the elasticsearch endpoint and created an API key with read only permissions as shown below.

{

"read-only-role": {

```
"cluster": \[\],

"indices": \[

  {

    "names": \[

      "\*"

    \],

    "privileges": \[

      "read"

    \],

    "allow_restricted_indices": false

  }

\],

"applications": \[\],

"run_as": \[\],

"metadata": {},

"transient_metadata": {

  "enabled": true

}

```

}

}

Then from Postman I am trying to run an API query for /users/auth/keys with the endpoint and API key I have but I get back 401 unauthorized. The error reads:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/7/779b141172dcb6281a2386bc6f9ee5eba7f70704.png)

Any ideas?

---

<div class="post-metadata">

**Author:** ![danN](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@danN](https://discuss.elastic.co/u/danN)\
**Post date:** [August 27, 2025, 8:14pm UTC](https://discuss.elastic.co/t/serverless-project-apis-returning-401s/381402/2 "2025-08-27T20:14:59Z")

</div>

Figured out the issue, I had to create a serverless project API key which I missed before.
