# Using the API, can't PUT to topic unless slug is on the URL

**URL:** <https://meta.discourse.org/t/using-the-api-cant-put-to-topic-unless-slug-is-on-the-url/50545>\
**Category:** Feature\
**Tags:** pr-welcome\
**Created:** [23 Septiembre, 2016 14:53 UTC](https://meta.discourse.org/t/using-the-api-cant-put-to-topic-unless-slug-is-on-the-url/50545 "2016-09-23T14:53:21Z")\
**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:** [23 Septiembre, 2016 14:53 UTC](https://meta.discourse.org/t/using-the-api-cant-put-to-topic-unless-slug-is-on-the-url/50545/1 "2016-09-23T14:53:21Z")

</div>

Found this out while writing a request to change the tags on a topic.

Basically, this doesn’t work:

```plaintext
PUT /t/123.json?api_username=...&api_key=...

{
  tags: ['a']
}

```

The server responds with:

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

```

However, if you put the topic slug on the URL, everything works fine (i.e. `PUT /t/why-arent-there-better-animals/123.json?api_username=...&api_key=...`)

This is inconsistent with the other topic API methods which do _not_ require a slug, and differs from the behavior described in the API documentation: [Discourse REST API Documentation](https://meta.discourse.org/t/discourse-api-documentation/22706)

---

_[View the full topic](https://meta.discourse.org/t/using-the-api-cant-put-to-topic-unless-slug-is-on-the-url/50545)._
