Prepare an image upload
Prepares the upload of one local image (PNG, JPEG, WebP or GIF, at most 15 MB; no SVG) for a Help Center article or a changelog.
- Call this with the file name, the real
contentTypeand the exactsizein bytes. - Send the file with one PUT to
uploadUrlwithin 10 minutes, with the returnedheaders.curlCommanddoes it: replace<path>with the file path. No API key is needed for the PUT: the URL is the credential. - The PUT answers
{ key, imgHtml }. PutimgHtml(<img src="" data-featurebase-content-key="…">) into an article body (formatter: 'raw'or'default') or a changelog'shtmlContentwithin 24 hours. Saving moves the image into that article or changelog.
One file per upload. Never send the image as base64 in a body.
PUT errors: 403 the token is not valid · 404 no such upload · 409 the file was already sent · 410 the URL expired (prepare again) · 411 no Content-Length · 400 the size is not the declared size · 413 larger than declared · 415 the Content-Type header or the bytes are not the declared image type (SVG is refused) · 429 too many uploads · 503 try again.
Body
The real type of the image. The bytes are checked against it. SVG is not accepted.
image/png, image/jpeg, image/webp, image/gifimage/pngThe file name, e.g. billing-settings.png. Only used for the stored name.
1 - 200billing-settings.pngResponse
Created
The PUT as a curl command. Replace <path> with the local file path and run it in a shell.
curl -sS -X PUT --data-binary @<path> -H 'Content-Type: image/png' 'https://do.featurebase.app/v2/uploads/…'Still need help? Ask the team