Upload app file

<Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Uploads a file to the app's storage and returns a link to it.

Send the file as multipart/form-data. Use the public link of an uploaded image as logo_url in Set app logo or as social_image_url in Set social image.

A public file gets a permanent link that anyone can open. A private file gets a signed link that expires after expires_in seconds, one hour at most, and this API has no way to get a new link for it. Upload a private file only when you use its link right away.

The size limit depends on the extension in the file name. For example, it's 40 MB for JPEG, PNG, GIF and WebP images, 5 MB for SVG, 100 MB for video and MP3 or WAV audio, and 10 MB for PDF and for any extension without its own limit. Executable and script files such as .exe, .bat, .jar and .apk are refused. Files are scanned for malware after the upload returns.

<Note>This endpoint accepts a personal API key belonging to a user with editor access to the app. A read-only key is refused, and workspace API keys are not accepted.</Note>

post/api/files/apps/{app_id}/upload

Path parameters

app_idstring required

ID of the app to upload the file to.

ID of the app to upload the file to.

Response

The stored file and its link.

file_uristring required

Storage URI of the file. mp/public/ or mp/private/ shows its visibility.

urlstring required

Link to the file. For a public file it's permanent and anyone with it can open the file. For a private file it's a signed link that stops working after expires_in seconds.

Example response

{
  "file_uri": "mp/public/6820f3a4e7b91d003c45a1f2/3f2504e0_logo.png",
  "url": "https://storage.base44.com/6820f3a4e7b91d003c45a1f2/3f2504e0_logo.png"
}

Changes

Changed in 1 of the 14 revisions of this API.1