# Get ID for updating a post

**URL:** https://meta.discourse.org/t/get-id-for-updating-a-post/47095
**Category:** Development
**Created:** [July 11, 2016, 1:41pm UTC](https://meta.discourse.org/t/get-id-for-updating-a-post/47095 "2016-07-11T13:41:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nisbeti](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nisbeti/32/121678_2.png) [@nisbeti](https://meta.discourse.org/u/nisbeti)
#### Post date: [July 11, 2016, 1:41pm UTC](https://meta.discourse.org/t/get-id-for-updating-a-post/47095/1 "2016-07-11T13:41:25Z")

</div>

When creating a new category, I must have an automatically created post, as: `Every category has an initial "About this category" topic.`  
So, I use the API to create the ‘group one’ category, then I get the `topic-url` from the result, and I can then use the API to change the title of the “About this category” topic.  
`curl -X PUT -d title="This is my new title for group one category" -d api_key=blahblah -d api_username=system http://localhost:3000/t/about-the-group-one-category/20`

I can then use the API to get the latest posts in that newly created category,  
`http://localhost:3000/c/group-one/l/latest.json`  
which gives me the default post and its `id`. If the `id` of the post is 55, then I notice that (using the reverse engineering approach), the `id` that must be updated is the `id + 3 = 58`

So, I can use this to change the default text of the post:  
`curl -X PUT -d post[raw]="This is the new text for the About this category initial post" -d api_key=blahblah 7 -d api_username=system http://localhost:3000/posts/58`

Is there a better way to get the `id` for updaing, or can I be certain that it will always be the post `id + 3`?

---

<div class="post-metadata">

### Author: ![Tom\_Newsom](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tom_newsom/32/115981_2.png) [@Tom\_Newsom](https://meta.discourse.org/u/Tom_Newsom)
#### Post date: [July 11, 2016, 2:08pm UTC](https://meta.discourse.org/t/get-id-for-updating-a-post/47095/2 "2016-07-11T14:08:54Z")

</div>

Why not just do `http://localhost:3000/t/about-the-group-one-category/20.json` and pull the `id` from the first post?
