# 500 or 400 when updating the content of a post using the API

**URL:** <https://meta.discourse.org/t/500-or-400-when-updating-the-content-of-a-post-using-the-api/115825>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [April 24, 2019, 9:30am UTC](https://meta.discourse.org/t/500-or-400-when-updating-the-content-of-a-post-using-the-api/115825 "2019-04-24T09:30:24Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jviotti](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jviotti/32/138866_2.png) [@jviotti](https://meta.discourse.org/u/jviotti)\
**Post date:** [April 24, 2019, 9:30am UTC](https://meta.discourse.org/t/500-or-400-when-updating-the-content-of-a-post-using-the-api/115825/1 "2019-04-24T09:30:24Z")

</div>

I’m trying to update the content of a post using the API. The docs at [Discourse API Docs](https://docs.discourse.org/#tag/Posts%2Fpaths%2F~1posts~1%7Bid%7D.json%2Fput) mention that I should use `PUT /posts/:id.json` sending `post[raw]` as a body.

This results in 400 along with:

```plaintext
errors: ['param is missing or the value is empty: post']

```

The error is complaining about a param called `post`, but replacing `post[raw]` with `post` in my HTTP request results in a 500 Internal Server Error response.

The post content was just `Edited comment`, so I don’t think it’s anything related to the content.

Am I missing something? Are the API docs out of date?

I’m running a cloud instance at [https://forums.balena.io](https://forums.balena.io). Not sure what the Discourse version is.

---

_[View the full topic](https://meta.discourse.org/t/500-or-400-when-updating-the-content-of-a-post-using-the-api/115825)._
