How to upload images to help center articles using the API
Upload the file with createWorkspaceFileUploadUrl, then reference it in the article's contentHtml with the data-workspace-file-id attribute. Plain fills in the src URL.
- Call
createWorkspaceFileUploadUrlwithvisibility: PUBLIC. The mutation returns aworkspaceFileId, a presigneduploadFormUrland a set ofuploadFormFields. - Make a multipart
POSTto theuploadFormUrl. Add all returneduploadFormFieldsas form fields first, then your file as thefilefield last. A successful upload returns HTTP 204. - In your
upsertHelpCenterArticlecall, add an<img>tag tocontentHtmlwithdata-workspace-file-idinstead ofsrc.
<img data-workspace-file-id="wf_01ABC123" alt="Description of image" />
When the article is saved, Plain moves the file to public storage. Once published, the image is served from a stable public URL that does not expire.
Why createWorkspaceFileDownloadUrl returns a 403
You do not need createWorkspaceFileDownloadUrl. It returns a signed URL for the file while it is still pending. A file only becomes public once an article references it with data-workspace-file-id, so using the download URL as an img src will always return a 403.
Limits
- Maximum file size: 50 MB
- Supported formats: JPEG, PNG, GIF, WebP, SVG
Self-hosted images
You can also use standard <img src="https://..."> tags in contentHtml to host images yourself. Plain does not restrict or proxy external image URLs, and no content security policy blocks them in the published help center.