Can't update a topic's body by API

just a guess from looking at the code, but perhaps it may be because you are using topic_id instead of post_id? because first post is the topic in Discourse, more or less?