Workflows exporting and reimporting help articles | Community
Skip to main content
Hi there, I'm looking for example workflows pulling help article content via API and then reimporting them back to intercom.
I'm a bit stuck at the moment as I try and pull articles using the Articles API, make edits, and push them back, but the formatting gets completely destroyed in the process.
Specifically:
  • When I pull an article using GET /articles/{id}, the HTML looks properly formatted with Intercom's wrapper divs and spacing
  • When I push the exact same content back using PUT /articles/{id}, Intercom's API automatically modifies the HTML and removes empty <p class="no-margin"></p> elements
  • This breaks the visual spacing and layout that was working before
Example of what happens:
  • Before API call: <p>Content</p><p class="no-margin"></p><p>More content</p> (proper spacing)
  • After API call: <p>Content</p><p>More content</p> (no spacing, content runs together)
Has anyone successfully implemented a workflow for editing articles via API while preserving the original Intercom formatting? Are there specific HTML patterns or attributes that Intercom requires to maintain proper spacing and layout? Any insights or working examples would be greatly appreciated!

Hey ​@Cody Iddings, Emily here from Support Engineering at Intercom 👋🏼

 

You’re encountering a common issue when editing Intercom articles via the API: Intercom’s API may modify or strip certain HTML elements (like empty <p class="no-margin"></p> tags) when you update articles, which can break your intended formatting and spacing.

Key points and suggestions:

  • When you retrieve an article using the API, you get the HTML as Intercom renders it, including their wrapper divs and spacing. However, when you update or create an article via the API, Intercom may sanitize or alter the HTML, especially removing empty tags or unsupported classes, which can affect layout and spacing.
  • There are no official guidelines for specific HTML classes or patterns that Intercom guarantees to preserve. The API accepts HTML in the "body" attribute, but you may need to experiment with different markup to see what is retained after an update.
  • To better understand what formatting is supported, you can use the "Retrieve an Article" API endpoint to inspect how Intercom stores and returns your content. This can help you identify which HTML elements and classes are preserved and which are stripped out.
  • If you want to maintain specific spacing, consider using non-empty elements or supported inline styles, as empty paragraphs or custom classes may be removed by Intercom’s sanitization process.

There are no documented workflows that guarantee preservation of all original formatting when round-tripping articles via the API. You may need to adjust your HTML or post-process the content after retrieval to ensure consistent appearance.


Hi ​@Emilygav that quite unfortunate! Makes for quite difficult and time consuming workflows! is there any expectation for this to change?