# Problem creating a category using the API

**URL:** <https://meta.discourse.org/t/problem-creating-a-category-using-the-api/59026>\
**Category:** Development\
**Created:** [13 مارس 2017، 9:19م UTC](https://meta.discourse.org/t/problem-creating-a-category-using-the-api/59026 "2017-03-13T21:19:00Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jack2](https://avatars.discourse-cdn.com/v4/letter/j/ac91a4/32.png) [@jack2](https://meta.discourse.org/u/jack2)\
**Post date:** [13 مارس 2017، 9:19م UTC](https://meta.discourse.org/t/problem-creating-a-category-using-the-api/59026/1 "2017-03-13T21:19:00Z")

</div>

I have successfully created a **topic** using the API (using entry point `posts`, as described [here](http://docs.discourse.org/#tag/Topics)), which makes me think my process is good.

But when I try to create a **category** (using entry point `categories.json`, as documented [here](http://docs.discourse.org/#tag/Categories%2Fpaths%2F~1categories.json%2Fpost), or entry point `categories`, as sniffed under Chrome using [this method](https://meta.discourse.org/t/how-to-reverse-engineer-the-discourse-api/20576), or even entry point `create_category`, as it seems to be used [here](https://github.com/discourse/discourse_api/blob/f0f1267072b1e5271f9450f2a647b23489b731b3/lib/discourse_api/api/categories.rb)), I get the following error:

```plaintext
Error: failed [400] <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Action Controller: Exception caught</ti
tle> <style> body { background-color: #FAFAFA; color: #333; margin: 0px; } body, p, ol, ul, td { font-family: helvetica, ve
rdana, arial, sans-serif; font-size: 13px; line-height: 18px; } pre { font-size: 11px; white-space: pre-wrap; } pre.bo
x { border: 1px solid #EEE; p

```

(followed by a dozen pages of css/html gibberish)

Any idea what I’m doing wrong?

---

_[View the full topic](https://meta.discourse.org/t/problem-creating-a-category-using-the-api/59026)._
