# Erro interno do servidor ao definir tags via API

**URL:** <https://meta.discourse.org/t/internal-server-error-setting-tags-via-the-api/100137>\
**Category:** Product Support\
**Created:** [22 Outubro , 2018 06:37 UTC](https://meta.discourse.org/t/internal-server-error-setting-tags-via-the-api/100137 "2018-10-22T06:37:04Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Akki9326](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@Akki9326](https://meta.discourse.org/u/Akki9326)\
**Post date:** [22 Outubro , 2018 06:37 UTC](https://meta.discourse.org/t/internal-server-error-setting-tags-via-the-api/100137/1 "2018-10-22T06:37:04Z")

</div>

We are getting below error while posting creating topic using API. sometimes its working but most of the time is shows below error.

```
Started POST "/posts.json?api_key=[FILTERED]&amp;username=saroj.barad&amp;title=Test%20%20From%20saroj&amp;category=7&amp;raw=Test%20%20From%20saroj&amp;tags%5B%5D=law&amp;tags%5B%5D=randomnewtag" for 127.0.0.1 at 2018-10-22 06:31:44 +0000

Processing by PostsController#create as JSON

Parameters: {"api_key"=&gt;"[FILTERED]", "username"=&gt;"saroj.barad", "title"=&gt;"Test From saroj", "category"=&gt;"7", "raw"=&gt;"Test From saroj", "tags"=&gt;["law", "randomnewtag"]}

Can't verify CSRF token authenticity.

Completed 500 Internal Server Error in 124ms (ActiveRecord: 8.8ms)

NoMethodError (undefined method `&gt;' for nil:NilClass)

/var/www/discourse/lib/discourse_tagging.rb:58:in `tag_topic_by_names'

Started POST "/posts.json" for 127.0.0.1 at 2018-10-22 06:32:27 +0000

Processing by PostsController#create as JSON

Parameters: {"title"=&gt;"Test from saroj", "category"=&gt;"7", "tags"=&gt;["finance"], "api_key"=&gt;"[FILTERED]", "api_username"=&gt;"saroj.barad", "raw"=&gt;"Test from saroj "}

Completed 500 Internal Server Error in 200ms (ActiveRecord: 8.0ms)

NoMethodError (undefined method `&gt;' for nil:NilClass)

```

---

_[View the full topic](https://meta.discourse.org/t/internal-server-error-setting-tags-via-the-api/100137)._
