Skip to content

Store Picked Image File

Tool name: upload-email-editor-image-file

Stores the file a person picked in the upload form of open-email-editor-image-upload, in a KlickTipp account's image library, and returns its public URL for an image block in update-email-editor-image-block (field src). JPEG, PNG, GIF or WebP up to 5 MB. Nothing is overwritten: a taken name is numbered, and the result says under which name the file was stored. This tool belongs to the upload form and is published for it alone -- a model has no file of its own to send, and base64 through a conversation is what the form exists to avoid. To let the user add a picture, call open-email-editor-image-upload; to add one from a public URL, upload-email-editor-image-from-url.

Input schema

fileNamestring, [ 1 .. 250 ] charactersrequired

Name of the picked file, as the browser reports it; sanitised, extension set from the bytes, a taken name is numbered, never overwritten -- see storedAs

contentBase64string, [ 1 .. 6990508 ] charactersrequired

The file's bytes as plain base64, no data: prefix

foldernull or string, <= 250 characters

Folder of the library to store it in, as list-email-editor-image-folders lists it; omit for the library's root

Default:null
accountIdnull or integer, >= 1

User ID of the account; omit for the account the access token works in

Default:null
Input example
{ "fileName": "string", "contentBase64": "string", "folder": null, "accountId": null }

Output schema

accountIdintegerrequired
uploadedbooleanrequired
storedAsstring or nullrequired
imageobject or nullrequired
foldersArray of stringsrequired
htmlstringrequired
Output example
{ "accountId": 0, "uploaded": true, "storedAs": "string", "image": { "url": "string", "path": "string", "fileName": "string", "mimeType": "string", "sizeBytes": 0, "uploadedAt": "string", "width": 0, "height": 0 }, "folders": [ "string" ], "html": "string" }