# GET directory\_items doesn't work with api-key provided

**URL:** https://meta.discourse.org/t/get-directory-items-doesnt-work-with-api-key-provided/172107
**Category:** Development
**Created:** [December 3, 2020, 12:29pm UTC](https://meta.discourse.org/t/get-directory-items-doesnt-work-with-api-key-provided/172107 "2020-12-03T12:29:26Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Mike\_Yermolayev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mike_yermolayev/32/201116_2.png) [@Mike\_Yermolayev](https://meta.discourse.org/u/Mike_Yermolayev)
#### Post date: [December 3, 2020, 12:29pm UTC](https://meta.discourse.org/t/get-directory-items-doesnt-work-with-api-key-provided/172107/1 "2020-12-03T12:29:27Z")

</div>

Hello,

I was trying to get all users using /directory\_items endpoint but what I figured out is that I can’t get it when I provide api-key with ‘read’ permissions.  
The strangest thing is that I can get it without any api-key provided at all, so it looks like a bug for me.

Please find my screenshots below:

No auth:

 ![image](https://global.discourse-cdn.com/meta/original/3X/d/d/ddd70990b5afb817a57b9afb4a476d0ecb7c4b6f.png)

api\_key with Topics:READ and Users:SHOW permissions:

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/1/21d637321f4c400d07525d263d661b858fe83387.png)

thanks in advance for any help!

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [December 3, 2020, 7:30pm UTC](https://meta.discourse.org/t/get-directory-items-doesnt-work-with-api-key-provided/172107/2 "2020-12-03T19:30:51Z")

</div>

There is no API scope for the user directory right now, so I’m not sure what “read” you enabled. Topics perhaps?

Scoped API keys will fail on routes that have no scoped defined, because they are meant for restricted use.

---

<div class="post-metadata">

### Author: ![Mike\_Yermolayev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mike_yermolayev/32/201116_2.png) [@Mike\_Yermolayev](https://meta.discourse.org/u/Mike_Yermolayev)
#### Post date: [December 7, 2020, 1:43pm UTC](https://meta.discourse.org/t/get-directory-items-doesnt-work-with-api-key-provided/172107/3 "2020-12-07T13:43:16Z")

</div>

by “read” permission I meant `Topics: read` and `User: show` scopes.

Okay, thanks for the answer. For now I switched to `admin/users/list/active` endpoint and use Global Key

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [December 7, 2020, 6:43pm UTC](https://meta.discourse.org/t/get-directory-items-doesnt-work-with-api-key-provided/172107/4 "2020-12-07T18:43:13Z")

</div>


