Skip to content
Help Center home
InboxAsk a human

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.

  1. Call createWorkspaceFileUploadUrl with the file name, its size in bytes, and visibility set to public. The mutation returns a workspaceFile.id, which starts with wFile_, plus a presigned upload URL and form fields.
  2. POST the image to the upload URL as a multipart form upload. Include all the form fields returned in step 1.
  3. In the article HTML, reference the image as <img data-workspace-file-id="<workspaceFileId>" alt="...">. Remove the original src attribute.
  4. Call upsertHelpCenterArticle with the updated contentHtml.

    For articles with several images, repeat steps 1 and 2 for each image, then include all the data-workspace-file-id references in a single upsertHelpCenterArticle call.