# API 500 response: removing member from group

**URL:** <https://meta.discourse.org/t/api-500-response-removing-member-from-group/105856>\
**Category:** Feature\
**Created:** [January 7, 2019, 3:16am UTC](https://meta.discourse.org/t/api-500-response-removing-member-from-group/105856 "2019-01-07T03:16:01Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)\
**Post date:** [January 7, 2019, 6:53pm UTC](https://meta.discourse.org/t/api-500-response-removing-member-from-group/105856/4 "2019-01-07T18:53:58Z")

</div>

> [@vvanpo](#):
>
> but I think it should still allow for a single integer to be passed

It does allow for a single integer to be passed (this is how the discourse app does it). Maybe you forgot to add it, but in your example you aren’t passing in a user\_id as a param?

> [@vvanpo](#):
>
> params api\_key \*\*\*\*\*\*\*\*\*\*\* api\_username system

The request in curl will look like this:

```plaintext
curl -i -sS -X DELETE "http://127.0.0.1:3000/groups/42/members.json" \
-H "Content-Type: multipart/form-data;" \
-F "api_key=api_key" \
-F "api_username=system" \ 
-F "user_id=3"

```

Where “42” is the group\_id and “3” is the user\_id.

Which returns

```plaintext
{"success":"OK","usernames":["27d52e4065601e0e28e3"]}

```

> [@vvanpo](#):
>
> It appears that your code is expected a comma-delimited string of user IDs, yet your documentation clearly indicates to use a single ID as an integer

I’ll be sure to add to the api docs the comma-delimited endpoint, but the single ID as an integer is still a valid way of removing a single user from a group.

> [@sam](#):
>
> Not sure how it even works to be honest, how is the ajax call able to pass a string there?

If its a string the ajax call wouldn’t use `params[:user_ids]` it would use `params[:usernames]` or `params[:user_emails]`.

---

_[View the full topic](https://meta.discourse.org/t/api-500-response-removing-member-from-group/105856)._
