# How to edit a post via api?

**URL:** https://meta.discourse.org/t/how-to-edit-a-post-via-api/40196
**Category:** Support
**Created:** [February 25, 2016, 11:00pm UTC](https://meta.discourse.org/t/how-to-edit-a-post-via-api/40196 "2016-02-25T23:00:05Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![warblesync](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/warblesync/32/51341_2.png) [@warblesync](https://meta.discourse.org/u/warblesync)
#### Post date: [February 25, 2016, 11:00pm UTC](https://meta.discourse.org/t/how-to-edit-a-post-via-api/40196/1 "2016-02-25T23:00:05Z")

</div>

I have a ruby script that generates the html I want to place in a post. So I need to create the topic and then be able to update it with the new data replacing the old post and the lock so it isn’t editable. Is that possible via api / automation?

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [February 25, 2016, 11:29pm UTC](https://meta.discourse.org/t/how-to-edit-a-post-via-api/40196/2 "2016-02-25T23:29:01Z")

</div>

Anything that’s possible on the site can be done via the API – the site is actually consuming the API.

To get started, do the actions you want to automate in your Browser while the Dev tools are open, looking at the network requests. Usually, the requests and answers are self-explanatory once you see them 🙂

---

<div class="post-metadata">

### Author: ![warblesync](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/warblesync/32/51341_2.png) [@warblesync](https://meta.discourse.org/u/warblesync)
#### Post date: [February 26, 2016, 12:02am UTC](https://meta.discourse.org/t/how-to-edit-a-post-via-api/40196/3 "2016-02-26T00:02:19Z")

</div>

Thanks I’ll try that out 🙂

---

<div class="post-metadata">

### Author: ![warblesync](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/warblesync/32/51341_2.png) [@warblesync](https://meta.discourse.org/u/warblesync)
#### Post date: [February 26, 2016, 12:13am UTC](https://meta.discourse.org/t/how-to-edit-a-post-via-api/40196/4 "2016-02-26T00:13:30Z")

</div>

PERFECT!!! That worked a treat! Thanks!

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [February 26, 2016, 10:54am UTC](https://meta.discourse.org/t/how-to-edit-a-post-via-api/40196/5 "2016-02-26T10:54:11Z")

</div>


