# Discourse-tagging plugin customization

**URL:** https://meta.discourse.org/t/discourse-tagging-plugin-customization/42227
**Category:** Feature
**Created:** [April 8, 2016, 8:07am UTC](https://meta.discourse.org/t/discourse-tagging-plugin-customization/42227 "2016-04-08T08:07:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![vikash159](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vikash159/32/121870_2.png) [@vikash159](https://meta.discourse.org/u/vikash159)
#### Post date: [April 8, 2016, 8:07am UTC](https://meta.discourse.org/t/discourse-tagging-plugin-customization/42227/1 "2016-04-08T08:07:07Z")

</div>

how we can create dynamically tags form our webapp using api or plugin.  
so i can attach later to some topic.

---

<div class="post-metadata">

### Author: ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)
#### Post date: [April 8, 2016, 12:49pm UTC](https://meta.discourse.org/t/discourse-tagging-plugin-customization/42227/2 "2016-04-08T12:49:57Z")

</div>

The easiest way that I can think of is using the Discourse API.

So you will need to either use an existing topic or create a new one, then using the API you submit a PUT request to that topic with the form data containing `tags[]` with the tags you want the topic to have.

If you use an existing topic, you will need to call the topic.json to get the current list of tags so you can append your new one to it.

Existing Topic:

- Call the json for the existing topic, `/t/testing-something-with-classes/76/1.json`
- Read the tags property
- Append new tag to the existing tags
- Send PUT to `/t/testing-something-with-classes/76` with form data key of `tags[]` and the value containing the tags you are sending (each tag should be on its own – see screenshot below)  
 ![](https://global.discourse-cdn.com/meta/original/3X/6/4/64c384c246f31c81726bd92c4d97009bae0d3e91.png)

_Note: Deleting all tags, you send a PUT command to the topic with a form data key of `tags_empty_array` and a value of `true`_

Creating a Topic

- Send POST command to `/posts` containing the raw, title, category, archetype (equal to regular), and tags (as noted above)

_Note: You do not need to send `tags_empty_array` if you do not apply any tags to a new topic_
