# Cannot post html

**URL:** <https://forum.ghost.org/t/cannot-post-html/56536>\
**Category:** Integrations & API\
**Created:** [April 2, 2025, 7:45am UTC](https://forum.ghost.org/t/cannot-post-html/56536 "2025-04-02T07:45:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BO\_BO](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/bo_bo/32/35581_2.png) [@BO\_BO](https://forum.ghost.org/u/BO_BO)\
**Post date:** [April 2, 2025, 7:45am UTC](https://forum.ghost.org/t/cannot-post-html/56536/1 "2025-04-02T07:45:31Z")

</div>

I am new to admin API, and I want to post an article to ghost. I am using python.

# first I prepare the token

GHOST\_API\_URL = “[http://localhost:3480/ghost/api/admin/posts/?format=html](http://localhost:3480/ghost/api/admin/posts/?format=html)”  
ADMIN\_API\_KEY = “67…:13…”  
id, secret = ADMIN\_API\_KEY.split(‘:’)  
iat = int(date.now().timestamp())

header = {‘alg’: ‘HS256’, ‘typ’: ‘JWT’, ‘kid’: id}  
payload = {  
‘iat’: iat,  
‘exp’: iat + 5 \* 60,  
‘aud’: ‘/admin/’  
}  
token = jwt.encode(payload, bytes.fromhex(secret), algorithm=‘HS256’, headers=header)

# then I post the data

post\_data = {  
“posts”: [  
{  
“title”: “test1”,  
“html”: “ **test1** ”,  
}  
]  
}

headers = {  
“Authorization”: f"Ghost {token}",  
“Content-Type”: “application/json”,  
}

response = requests.post(GHOST\_API\_URL, json=post\_data, headers=headers)

The title is posted, but the html is not posted. Why? How can I post the html? Please help.

Thanks!
