# I am unable to create a new topic by API using CURL or POSTMAN

**URL:** https://meta.discourse.org/t/i-am-unable-to-create-a-new-topic-by-api-using-curl-or-postman/149592
**Category:** Development
**Tags:** rest-api
**Created:** [April 28, 2020, 1:40pm UTC](https://meta.discourse.org/t/i-am-unable-to-create-a-new-topic-by-api-using-curl-or-postman/149592 "2020-04-28T13:40:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Faizan\_Zahid](https://avatars.discourse-cdn.com/v4/letter/f/b9bd4f/32.png) [@Faizan\_Zahid](https://meta.discourse.org/u/Faizan_Zahid)
#### Post date: [April 28, 2020, 1:40pm UTC](https://meta.discourse.org/t/i-am-unable-to-create-a-new-topic-by-api-using-curl-or-postman/149592/1 "2020-04-28T13:40:36Z")

</div>

My CURL request is,

```plaintext
curl -X POST "https://mysite.com/posts.json" \
-H "Api-Key: mykey" \
-H "Api-Username: system" \
-H "title: How many hours are in a year and How many seconds are in a year?" \
-H "raw: this is my first topic by api, lets see if it works or not"

```

I am getting this error in console,

 ![image](https://global.discourse-cdn.com/meta/original/3X/c/7/c78829e719ae792bc2f9093ad66acce4469be2f6.png)

What am i doing wrong? i have tried to use a longer title too.

Can you provide me a sample code to make a new topic by CURL and by postman ?

---

<div class="post-metadata">

### Author: ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)
#### Post date: [April 28, 2020, 1:49pm UTC](https://meta.discourse.org/t/i-am-unable-to-create-a-new-topic-by-api-using-curl-or-postman/149592/2 "2020-04-28T13:49:10Z")

</div>

Yea, use `-F` for the title and raw so that those values aren’t in the header.

```plaintext
curl -i -sS -X POST "http://localhost:3000/posts.json" \
-H "Content-Type: multipart/form-data;" \
-H "Api-Key: asdfasdf..." \
-H "Api-Username: system" \
-F "title=f8363e27e93 1686ad52d92 e74621a4c13" \
-F "raw=1fc960baee7cada5037d4325ffb229ed a83286e99dc8bd6d688edae193d634a9 b608bbde2fb09e90fc4c21b5c22afe2b"

```
