On by default
Uploads
Upload File
Upload an image or file to Discourse. Provide either: image_data (base64 with filename), a remote HTTP(S) URL, or an absolute local file path. user_id is required for avatar/background uploads. Returns upload_id for use in avatar/profile updates. Use short_url to embed images in posts.
Parameters
upload_ typestringavatarprofile_backgroundcard_backgroundcomposerrequiredType of upload
image_ datastringBase64 image data (with or without data URI prefix)
urlstringRemote HTTP(S) URL for Discourse to fetch, or file:// URL / absolute local path
filenamestringFilename (required with image_data, optional for file paths)
user_ idintegerUser ID (required for avatar/profile_background/card_background uploads)