# Admin API add a new post

**URL:** <https://forum.ghost.org/t/admin-api-add-a-new-post/17652>\
**Category:** Developer help\
**Created:** [October 13, 2020, 11:56am UTC](https://forum.ghost.org/t/admin-api-add-a-new-post/17652 "2020-10-13T11:56:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LinkOut](https://avatars.discourse-cdn.com/v4/letter/l/ba8739/32.png) [@LinkOut](https://forum.ghost.org/u/LinkOut)\
**Post date:** [October 13, 2020, 11:56am UTC](https://forum.ghost.org/t/admin-api-add-a-new-post/17652/1 "2020-10-13T11:56:24Z")

</div>

Hi, im trying to use the ghost API to add a post on the website…

```
const GHOST_API = new GhostAdminAPI({
    url: END_POINT,
    version: "v3",
    key: GHOST_KEY
});

GHOST_API.posts.add({
    title: 'My first draft API post',
    mobiledoc: '{\"version\":\"0.3.1\",\"atoms\":[],\"cards\":[],\"markups\":[],\"sections\":[[1,\"p\",[[0,[],0,\"My post content. Work in progress...\"]]]]}'
}).then(result => {
    res.send(JSON.stringify(result) + " - SUCCESS!")
}).catch(err => {
    res.send(JSON.stringify(err) + " - ERROR!")
});

```

The `result` being the Array of posts i already have, but it does not add the new one.

Ive used this guide: [https://ghost.org/docs/api/v3/javascript/admin/](https://ghost.org/docs/api/v3/javascript/admin/)

---

<div class="post-metadata">

**Author:** ![LinkOut](https://avatars.discourse-cdn.com/v4/letter/l/ba8739/32.png) [@LinkOut](https://forum.ghost.org/u/LinkOut)\
**Post date:** [October 19, 2020, 6:51am UTC](https://forum.ghost.org/t/admin-api-add-a-new-post/17652/2 "2020-10-19T06:51:10Z")

</div>

Hello,  
There is a little update: i’ve tried post and pages, without success, i tried different ways of postring from api wich are: html, mobiledoc, using full tags, using full users (primary\_user) nothing works… All i receive back is the already existing list of posts/pages.

Anyone have any idea? Maybe someone who correctly posted from API?

---

<div class="post-metadata">

**Author:** ![Kevin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kevin/32/32_2.png) [@Kevin](https://forum.ghost.org/u/Kevin)\
**Post date:** [October 20, 2020, 7:15am UTC](https://forum.ghost.org/t/admin-api-add-a-new-post/17652/3 "2020-10-20T07:15:32Z")

</div>

> All i receive back is the already existing list of posts/pages.

If you’re getting that response back then it sounds like something is causing your code to not hit the right API endpoint, you’ve somehow managed to have a GET response cached as your POST response, or your own service’s response has been cached.

I’d try using `console.log(result)` and following your service’s logs to make sure it’s actually being called (if it’s not then your client is returning a cached result) and to see what the real response from Ghost’s API is.

It would help if you posted a bit more about the environment in which you’re trying to use the API.

---

<div class="post-metadata">

**Author:** ![LinkOut](https://avatars.discourse-cdn.com/v4/letter/l/ba8739/32.png) [@LinkOut](https://forum.ghost.org/u/LinkOut)\
**Post date:** [October 20, 2020, 7:40am UTC](https://forum.ghost.org/t/admin-api-add-a-new-post/17652/4 "2020-10-20T07:40:28Z")

</div>

Hi Kevin, thanks for the answer.  
The environment is a simple Express app, actually the template version from the IntelliJ Webstorm IDE.  
I have a test route eg: `router.post('/test'), function (req,res) {//...});`  
There i wanted to test those APIs…

So far what i saw is that the `makeApiRequest` function is called into the library index.js and those params are all correct: endpoint is correct, method is POST, body seems correct actually is a Array of posts containing 1 post and so on…  
I cannot really understand where i do wrong on this…

Thanks
