Skip to content

Upload an image

bash
POST /v1/assets/upload
Authorization: Bearer mms_live_YOUR_KEY
Content-Type: multipart/form-data

file=@photo.jpg
json
{
  "url": "https://res.cloudinary.com/mms/image/upload/..."
}

The returned URL is a permanent Cloudinary CDN URL. Pass it as the src prop of an Image block.

Supported formats

FormatMIME type
JPEGimage/jpeg
PNGimage/png
WebPimage/webp
GIFimage/gif

Maximum file size: 10 MB.

Storage limits

Image storage counts against your plan's storageMb limit:

PlanStorage
Free50 MB
Pro500 MB
Agency3 GB
EnterpriseUnlimited

Uploads that would exceed the limit return 402 Payment Required:

json
{ "error": "Storage limit reached — upgrade your plan" }

JavaScript example

js
async function uploadImage(file) {
  const form = new FormData();
  form.append('file', file);

  const res = await fetch('https://api.maillune.com/v1/assets/upload', {
    method: 'POST',
    headers: { Authorization: `Bearer ${API_KEY}` },
    body: form,
  });

  if (!res.ok) {
    const { error } = await res.json();
    throw new Error(error);
  }

  const { url } = await res.json();
  return url;
}

The built-in image upload UI in the editor handles this automatically — you only need to call this endpoint directly if you're building a custom image picker.