Skip to main content
Question

API: Adding/uploading images with API to Knowledge Base articles


When creating new articles with API, can I include images in the content? The API docs talk about only ‘featured images’ (thumbnails etc.), but what about actual images within the “normal” content?

2 replies

DannyPancratz
Forum|alt.badge.img+7
  • VIP ⭐️⭐️⭐️⭐️⭐️
  • 966 replies
  • April 3, 2025

They likely can be, as part of what you input in the json payload as part of the “content” key value pair. 

It should accept HTML, so you’ll need a URL to reference in your HTML; one that will remain accessible or the image will break when it’s no longer referencible via the HTML on that article. 

I’ll also note, that while you should be able to put HTML in your payload, it still needs to be a working json. So you’ll need to take steps to ensure the HTML doesn’t invalidate the JSON structure. JSON Linters like this one are helpful. 

But if you run into trouble here, it’ll be faster to just publish the article via the backend control. Unless there’s something critical to your use case that it goes through the API. 


  • Author
  • Contributor ⭐️
  • 1 reply
  • April 4, 2025

Thanks, that sounds a bit advanced for my use case -- what I think I’m after is an endpoint for uploading images in the API, using local images that I have on my computer alongside the article.

So ability to upload the local, relative path images that referenced in my local content/article files.

I mean, it seems a bit cumbersome that I can create 25 articles with the API in a flash, but if I want to have images in those articles (say, 5 per article), I need to add them manually one by one in the backend UI ...


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings