# Attaching feature image to post created - using API

**URL:** <https://forum.ghost.org/t/attaching-feature-image-to-post-created-using-api/41292>\
**Category:** Integrations & API\
**Created:** [September 18, 2023, 1:31pm UTC](https://forum.ghost.org/t/attaching-feature-image-to-post-created-using-api/41292 "2023-09-18T13:31:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mheland](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mheland/32/26236_2.png) [@mheland](https://forum.ghost.org/u/mheland)\
**Post date:** [September 18, 2023, 1:31pm UTC](https://forum.ghost.org/t/attaching-feature-image-to-post-created-using-api/41292/1 "2023-09-18T13:31:15Z")

</div>

So, I’m creating posts using the admin API and it works great.

Can’t figure out how to upload and attach an image as feature image.

Is it a two-step process? First (1) upload over API and then (2) create post using the  
`"feature_image": "[url]"` from step 1? Or how does this work?

Any assistance highly appreciated.

Thank you  
/magnus

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [September 18, 2023, 1:33pm UTC](https://forum.ghost.org/t/attaching-feature-image-to-post-created-using-api/41292/2 "2023-09-18T13:33:42Z")

</div>

That’s right. Upload the image first, get the image reference, then create (or update) the post.

---

<div class="post-metadata">

**Author:** ![Nigel\_Morford](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/nigel_morford/32/26397_2.png) [@Nigel\_Morford](https://forum.ghost.org/u/Nigel_Morford)\
**Post date:** [September 18, 2023, 1:50pm UTC](https://forum.ghost.org/t/attaching-feature-image-to-post-created-using-api/41292/3 "2023-09-18T13:50:36Z")

</div>

Could you confirm that this is correct? Im uploading the image, which is successful, then creating a post with this data. The feature image variable holds the link to the uploaded image.

```
    post_data = {
        "title": title,
        "date": date,
        "content": content,
        # "feature_image": feature_image # Include the image URL here
    }

```

---

<div class="post-metadata">

**Author:** ![mheland](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mheland/32/26236_2.png) [@mheland](https://forum.ghost.org/u/mheland)\
**Post date:** [September 18, 2023, 2:23pm UTC](https://forum.ghost.org/t/attaching-feature-image-to-post-created-using-api/41292/4 "2023-09-18T14:23:41Z")

</div>

Thank you @Cathy_Sarisky
