# Rename Topic using API

**URL:** <https://meta.discourse.org/t/rename-topic-using-api/65962>\
**Category:** Product Support\
**Created:** [July 10, 2017, 7:09pm UTC](https://meta.discourse.org/t/rename-topic-using-api/65962 "2017-07-10T19:09:33Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)\
**Post date:** [July 18, 2017, 2:37am UTC](https://meta.discourse.org/t/rename-topic-using-api/65962/8 "2017-07-18T02:37:59Z")

</div>

Next time can you please include any error messages you have. What is the response code? What is the response text that you get back?

I don’t know much about python, but maybe it has something to do with newline characters in your data hash.

This code works fine:

```
import requests
url = 'http://192.168.56.2:3000/t/-/1.json'
data = {'api_key': '62bb871486b3bf12af6dde4610e6b2d825588eccd6b0b6ea5de0f35c129992fc','api_username': 'system','title': 'This topic was renamed with python'}
response = requests.put(url, data=data)
print response
print response.text

```

output:

```
python app.py
<Response [200]>
{"basic_topic":{"id":1,"title":"This topic was renamed with python","fancy_title":"This topic was renamed with python","slug":"this-topic-was-renamed-with-python","posts_count":1}}

```

---

_[View the full topic](https://meta.discourse.org/t/rename-topic-using-api/65962)._
