# Get API Key only for adding/removing users from a group

**URL:** https://meta.discourse.org/t/get-api-key-only-for-adding-removing-users-from-a-group/239850
**Category:** Development
**Tags:** rest-api
**Created:** [September 23, 2022, 11:04am UTC](https://meta.discourse.org/t/get-api-key-only-for-adding-removing-users-from-a-group/239850 "2022-09-23T11:04:04Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Felixkruemel](https://avatars.discourse-cdn.com/v4/letter/f/c0e974/32.png) [@Felixkruemel](https://meta.discourse.org/u/Felixkruemel)
#### Post date: [September 23, 2022, 11:04am UTC](https://meta.discourse.org/t/get-api-key-only-for-adding-removing-users-from-a-group/239850/1 "2022-09-23T11:04:04Z")

</div>

Hey,

I want to create a simple script to add a user to an existing group inside my Discourse instance. According to the docs this is done with the /groups endpoint.

However when creating an API key I can’t specify a scope to only include that endpoint. How can I create an API key which only has the permissions to add/remove users from a group?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [September 23, 2022, 5:58pm UTC](https://meta.discourse.org/t/get-api-key-only-for-adding-removing-users-from-a-group/239850/2 "2022-09-23T17:58:51Z")

</div>

See [Granular API key restriction missing a lot of endpoints - #2 by pfaffman](https://meta.discourse.org/t/granular-api-key-restriction-missing-a-lot-of-endpoints/239849/2).

Seems like the same question? (You were probably first)
