"https://gorest.co.in/public/v2/posts" This returns a list of posts. So it doesn't have id as a parameter.
"https://gorest.co.in/public/v2/posts"
id
Try using .body("find { it.id == 167039 }.id", equalTo(167039))
.body("find { it.id == 167039 }.id", equalTo(167039))