# Issues with creating a post and locking the topic via the API

**URL:** <https://meta.discourse.org/t/issues-with-creating-a-post-and-locking-the-topic-via-the-api/159003>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [July 28, 2020, 2:55am UTC](https://meta.discourse.org/t/issues-with-creating-a-post-and-locking-the-topic-via-the-api/159003 "2020-07-28T02:55:38Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![AstonJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/astonj/32/215041_2.png) [@AstonJ](https://meta.discourse.org/u/AstonJ)\
**Post date:** [July 28, 2020, 2:55am UTC](https://meta.discourse.org/t/issues-with-creating-a-post-and-locking-the-topic-via-the-api/159003/1 "2020-07-28T02:55:38Z")

</div>

I’m locking a topic via the API (gem) and am able to lock it and unlock if that is the only command in the chain, but when I create a post in the topic beforehand, and the next command is to lock it - it makes the post, then locks it, but then immediately unlocks it!

This is really odd. If I _just_ make the post, or _just_ lock the topic, it works fine. But if I try to do both it ends up unlocking the topic at the end of its own accord!

For now I’ve decided to just not lock the topic - but thought I’d post here in case it’s something worth investigating.

---

_[View the full topic](https://meta.discourse.org/t/issues-with-creating-a-post-and-locking-the-topic-via-the-api/159003)._
