# Adding user to group from API gets "BAD CSRF"

**URL:** <https://meta.discourse.org/t/adding-user-to-group-from-api-gets-bad-csrf/66430>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [July 19, 2017, 10:11am UTC](https://meta.discourse.org/t/adding-user-to-group-from-api-gets-bad-csrf/66430 "2017-07-19T10:11:39Z")\
**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:** [July 19, 2017, 2:33pm UTC](https://meta.discourse.org/t/adding-user-to-group-from-api-gets-bad-csrf/66430/4 "2017-07-19T14:33:37Z")

</div>

I see what you mean since the examples in the [api docs](http://docs.discourse.org) are in json, but that is mostly just for readability and is more like sudo code for you to use whatever tool you desire to make api calls. I’ll add a line to the top of the docs about using form-data but I still doubt people will read it.

> [@pfaffman](#):
>
> rather than looking at the docs.

You mean these docs with the answer you were looking for? 😉

 ![](https://global.discourse-cdn.com/meta/original/3X/f/7/f79301b1b8cca5c677f0dfd818d931463ba50bcd.png)

---

_[View the full topic](https://meta.discourse.org/t/adding-user-to-group-from-api-gets-bad-csrf/66430)._
