# Adding group members vs adding owners: data format is different

**URL:** <https://meta.discourse.org/t/adding-group-members-vs-adding-owners-data-format-is-different/144477>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [March 16, 2020, 2:07pm UTC](https://meta.discourse.org/t/adding-group-members-vs-adding-owners-data-format-is-different/144477 "2020-03-16T14:07:45Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![bennett](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bennett/32/171668_2.png) [@bennett](https://meta.discourse.org/u/bennett)\
**Post date:** [March 16, 2020, 2:07pm UTC](https://meta.discourse.org/t/adding-group-members-vs-adding-owners-data-format-is-different/144477/1 "2020-03-16T14:07:45Z")

</div>

When using the API to add members and owners to a group, it looks like the required data format is different. This may be intentional but I’d like to know why (it’s breaking pydiscourse, the best library I can find for interacting with the Discourse API in Python).

Adding a member to a group:

```
curl -X PUT "https://{mydomain}/admin/groups/{group_id}/members.json" \ 
    -d 'usernames={my-username}' \
    -H "Api-Key: {my-api-key}" \
    -H "Api-Username: {my-api-username}"

```

Adding an owner to a group:

```
curl -X PUT "https://{mydomain}/admin/groups/{group_id}/owners.json" \ 
    -d 'group[usernames]={my-username}' \
    -H "Api-Key: {my-api-key}" \
    -H "Api-Username: {my-api-username}"

```

I’m curious why the key for the username param in the owners endpoint needs to be written as `group[usernames]` instead of just `usernames`?

---

_[View the full topic](https://meta.discourse.org/t/adding-group-members-vs-adding-owners-data-format-is-different/144477)._
