# É possível alterar a timestamp de um tópico?

**URL:** <https://meta.discourse.org/t/possible-to-change-a-topics-timestamp/329509>\
**Category:** Product Support\
**Created:** [Outubro 5, 2024, 11:42pm UTC](https://meta.discourse.org/t/possible-to-change-a-topics-timestamp/329509 "2024-10-05T23:42:18Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![fbpbdmin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fbpbdmin/32/300893_2.png) [@fbpbdmin](https://meta.discourse.org/u/fbpbdmin)\
**Post date:** [Outubro 5, 2024, 11:42pm UTC](https://meta.discourse.org/t/possible-to-change-a-topics-timestamp/329509/1 "2024-10-05T23:42:18Z")

</div>

Gostaria de alterar o carimbo de data/hora de um tópico, encontrei esta API

> **[Discourse API Docs](https://docs.discourse.org/#tag/Topics/operation/updateTopicTimestamp)**

Enquanto isso, recebi um erro com “Bad CSRF”, alguém poderia dar uma dica? obrigado

```plaintext
import requests

# cabeçalhos incorretos
headers = {
    "Authorization": f"Apikey {api_key}",
    "User-Agent": api_username
}

# correto
headers = {"Content-Type": "application/json; charset=utf-8", "Api-Key": api_key, "Api-Username": api_username }

# Modificar a data de postagem
created_at = "1701417600"
update_data = {"timestamp": created_at}
response = requests.put(f"https://www.mysite.com/t/6532/change-timestamp.json", json=update_data, headers=headers)

print(response.status_code) # 403
print(response.text) # '["BAD CSRF"]'
print(response.json()) # ['BAD CSRF']

```

---

_[View the full topic](https://meta.discourse.org/t/possible-to-change-a-topics-timestamp/329509)._
