# Can't create topic with tag using admin API due to insufficient trust level

**URL:** <https://meta.discourse.org/t/cant-create-topic-with-tag-using-admin-api-due-to-insufficient-trust-level/46972>\
**Category:** Development\
**Created:** [July 7, 2016, 9:34pm UTC](https://meta.discourse.org/t/cant-create-topic-with-tag-using-admin-api-due-to-insufficient-trust-level/46972 "2016-07-07T21:34:29Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![cappslock](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cappslock/32/120789_2.png) [@cappslock](https://meta.discourse.org/u/cappslock)\
**Post date:** [July 7, 2016, 9:34pm UTC](https://meta.discourse.org/t/cant-create-topic-with-tag-using-admin-api-due-to-insufficient-trust-level/46972/1 "2016-07-07T21:34:29Z")

</div>

I have not been able to create a topic with a tag using the admin API (i.e. when I include api\_key and api\_username on the query string).

POSTing to /posts, I attempted to use the `tags[]` param I see in the UI’s calls to the API, which were happily ignored. I also tried to post with a `tag` param which caused the server to 500:

```plaintext
NoMethodError in PostsController#create
undefined method `-' for "testing123":String Did you mean? -@

Extracted source (around line #163):
161
162
163
164
165
166
              
    staff_tags = SiteSetting.staff_tags.split("|")

    tag_diff = tags - staff_tags
    tag_diff = tags - tag_diff

    tag_diff.present? ? tag_diff : nil

Rails.root: /vagrant

lib/discourse_tagging.rb:163:in `staff_only_tags'
lib/topic_creator.rb:28:in `valid?'
lib/has_errors.rb:10:in `validate_child'
lib/post_creator.rb:93:in `valid?'
lib/post_creator.rb:124:in `create'
lib/new_post_manager.rb:145:in `perform_create_post'
lib/new_post_manager.rb:119:in `perform'
app/controllers/posts_controller.rb:142:in `block in create'
lib/distributed_memoizer.rb:28:in `memoize'
app/controllers/posts_controller.rb:141:in `create'
config/initializers/100-quiet_logger.rb:13:in `call_with_quiet_assets'
config/initializers/100-silence_logger.rb:26:in `call'
lib/middleware/missing_avatars.rb:21:in `call'
lib/middleware/turbo_dev.rb:33:in `call'

Request

Parameters:

{"title"=>"sdaf dsfa sdfa sfd sfda sfd sfd sfd sfda ",
 "raw"=>"wr awd wa w adaw aw dn lef galgj ",
 "tags"=>"testing123",
 "api_key"=> (scrubbed),
 "api_username"=>"user8"}

```

Using the API, is there a way to create a topic with a tag? Failing that, is there a way to add a tag after the fact?

---

_[View the full topic](https://meta.discourse.org/t/cant-create-topic-with-tag-using-admin-api-due-to-insufficient-trust-level/46972)._
