# Issue in post creation API

**URL:** https://meta.discourse.org/t/issue-in-post-creation-api/201667
**Category:** Development
**Tags:** rest-api
**Created:** [August 25, 2021, 11:57am UTC](https://meta.discourse.org/t/issue-in-post-creation-api/201667 "2021-08-25T11:57:45Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nishantwrp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nishantwrp/32/232189_2.png) [@nishantwrp](https://meta.discourse.org/u/nishantwrp)
#### Post date: [August 25, 2021, 11:57am UTC](https://meta.discourse.org/t/issue-in-post-creation-api/201667/1 "2021-08-25T11:57:45Z")

</div>

I am working on [this forum](https://discourse.joplinapp.org/) which is powered by Discourse. After the moderators provided me with an api key and username, I found a bug in the `POST /posts.json` API endpoint.

As mentioned [here](https://docs.discourse.org/#tag/Posts/paths/~1posts.json/post) this endpoint accepts a `topic_id` which should be an **integer**. But when I make a request using the `topic_id` and `raw` parameters something like

```json
{
  "topic_id": 17470,
  "raw": "Test post."
}

```

I get the following error.

```plaintext
'You are not permitted to view the requested resource. The API username or key is invalid.'

```

But I am successfully able to create the post after changing the request data such that `topic_id` is a string.

```plaintext
  "topic_id": "17470",
  "raw": "Test post."
}

```

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [August 26, 2021, 5:15am UTC](https://meta.discourse.org/t/issue-in-post-creation-api/201667/2 "2021-08-26T05:15:30Z")

</div>

Something does not sound right, from the perspective of an HTTP POST there is no difference between `100` and `"100"`.

Can you provide with a consistent repro here?
