How to include images when migrating help center articles to Plain
Article text and structure migrate cleanly from Intercom or another platform using the MCP or the GraphQL API. Images need one extra step: the Plain MCP has no file upload tool, so you upload each image with a direct GraphQL API call first.
How images work in help center articles
The upsertHelpCenterArticle mutation, available through both the MCP and the GraphQL API, accepts contentHtml containing <img> tags. When an <img> tag has a data-workspace-file-id attribute, Plain fills in the hosted image URL automatically.
Upload images with the GraphQL API
File uploads use the createWorkspaceFileUploadUrl mutation. Call the GraphQL API directly with your Plain API key in the Authorization header.
- Call
createWorkspaceFileUploadUrlwith the file name, its size in bytes, andvisibilityset topublic. The mutation returns aworkspaceFile.id, which starts withwFile_, plus a presigned upload URL and form fields. - POST the image to the upload URL as a multipart form upload. Include all the form fields returned in step 1.
- In the article HTML, reference the image as
<img data-workspace-file-id="<workspaceFileId>" alt="...">. Remove the originalsrcattribute. - Call
upsertHelpCenterArticlewith the updatedcontentHtml.For articles with several images, repeat steps 1 and 2 for each image, then include all the
data-workspace-file-idreferences in a singleupsertHelpCenterArticlecall.