# Not able to Update Tags using API

**URL:** https://meta.discourse.org/t/not-able-to-update-tags-using-api/158623
**Category:** Support
**Created:** [July 23, 2020, 3:04pm UTC](https://meta.discourse.org/t/not-able-to-update-tags-using-api/158623 "2020-07-23T15:04:31Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Minhaj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/minhaj/32/137595_2.png) [@Minhaj](https://meta.discourse.org/u/Minhaj)
#### Post date: [July 23, 2020, 3:04pm UTC](https://meta.discourse.org/t/not-able-to-update-tags-using-api/158623/1 "2020-07-23T15:04:31Z")

</div>

I am sending a `PUT` request to `http://localhost:3000/t/220.json` with `{"tags":["bug"]}` to update the tags on my topic with ID `220`.

I am getting Error 403  
`{"errors":["You are not permitted to view the requested resource."],"error_type":"invalid_access"}`.

Can someone tell me what I am doing wrong here?

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [July 23, 2020, 3:08pm UTC](https://meta.discourse.org/t/not-able-to-update-tags-using-api/158623/2 "2020-07-23T15:08:45Z")

</div>

Some endpoints require an authentication. You will need to pass an API user and key: [https://docs.discourse.org/](https://docs.discourse.org/)

---

<div class="post-metadata">

### Author: ![Minhaj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/minhaj/32/137595_2.png) [@Minhaj](https://meta.discourse.org/u/Minhaj)
#### Post date: [July 23, 2020, 3:13pm UTC](https://meta.discourse.org/t/not-able-to-update-tags-using-api/158623/3 "2020-07-23T15:13:28Z")

</div>

I have taken care of authentication. Infact, I am able to add post on the same topic from API.

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [July 23, 2020, 3:33pm UTC](https://meta.discourse.org/t/not-able-to-update-tags-using-api/158623/4 "2020-07-23T15:33:26Z")

</div>

I don’t know then, but the url should be `/t/-/220.json ` if you don’t provide a slug.

---

<div class="post-metadata">

### Author: ![Minhaj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/minhaj/32/137595_2.png) [@Minhaj](https://meta.discourse.org/u/Minhaj)
#### Post date: [July 23, 2020, 4:43pm UTC](https://meta.discourse.org/t/not-able-to-update-tags-using-api/158623/5 "2020-07-23T16:43:10Z")

</div>

Thanks, It worked. But can you elaborate what is a slug in terms?

---

<div class="post-metadata">

### Author: ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)
#### Post date: [July 23, 2020, 4:57pm UTC](https://meta.discourse.org/t/not-able-to-update-tags-using-api/158623/6 "2020-07-23T16:57:07Z")

</div>

Your SEO-friendly topic title in this case.  
This slug here is: `not-able-to-update-tags-using-api` (look tat the bar address)

By the way, this tip about `-` is actually from the documentation:

 ![image](https://global.discourse-cdn.com/meta/original/3X/b/a/bacf319ab872483a90b5aa6d92ea875540822994.png)

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [August 22, 2020, 4:57pm UTC](https://meta.discourse.org/t/not-able-to-update-tags-using-api/158623/7 "2020-08-22T16:57:08Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
