# Groups API: Using User IDs instead of Usernames?

**URL:** https://meta.discourse.org/t/groups-api-using-user-ids-instead-of-usernames/366059
**Category:** Support
**Tags:** rest-api
**Created:** [May 14, 2025, 9:03am UTC](https://meta.discourse.org/t/groups-api-using-user-ids-instead-of-usernames/366059 "2025-05-14T09:03:12Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![th-afm](https://avatars.discourse-cdn.com/v4/letter/t/ee59a6/32.png) [@th-afm](https://meta.discourse.org/u/th-afm)
#### Post date: [May 14, 2025, 9:03am UTC](https://meta.discourse.org/t/groups-api-using-user-ids-instead-of-usernames/366059/1 "2025-05-14T09:03:12Z")

</div>

Hello everyone,

I’m currently working with the Discourse API, specifically with the groups endpoints. I’ve noticed something that I’d like to get your opinion on.

## The Problem

For adding and removing users from groups, I’m using:

- `POST /groups/{id}/members.json` for adding
- `DELETE /groups/{id}/members.json` for removing

According to the documentation, both endpoints expect **usernames** in the request body (as the `usernames` parameter). This means when I only have User IDs, I first need to make an additional API call to `GET /admin/users/{id}.json` for each ID to retrieve the corresponding username.

## The Question

**Is there a way to use User IDs directly** instead of usernames? This would save me an additional API call per user and significantly improve performance, especially for larger batch operations.

## Background

I’m working on an application that frequently needs to manage larger groups of users based on their IDs. The additional step of fetching usernames makes the process considerably slower and more complex.

Thank you for your help!

**API Version Used:** Discourse API v2
