Sada Files

Developer docs

  1. Developers
  2. Tool endpoints

Resize Image API

Resize by pixels, percentage, longest side or target file size — lock aspect ratio, never enlarge, pick the resampling filter, batch.

Environment

EnvironmentBase URL
Productionhttps://api.sadafiles.com/v1

There is one environment and no sandbox, so every request here is real and counts toward your limits.

Request

POSThttps://api.sadafiles.com/v1/tools/resize-image
Content type
multipart/form-data
Auth
X-API-Key with tools:run
Accepts
jpg, png, webp, avif, gif, bmp, tiff, heic and 1 more
Files per request
1 to 500
Largest file
2 GB
Job timeout
120 s
Rate weight
2 units

Parameters

Send these as a JSON string in the options form field. Anything else is rejected.

NameTypeDefaultAllowed
modestringpixelspixels, percent, longestSide, targetSize
widthinteger—min 1, max 30000, px
heightinteger—min 1, max 30000, px
percentinteger50min 1, max 1000, %
longestinteger1920min 1, max 30000, px
targetKbOptional maximum KB after resizing. Pixel dimensions are preserved; impossible limits report an error.integer—min 5, KB
keepAspectbooleantrue—
noEnlargebooleantrue—
fitstringinsideinside, cover, fill, contain
filterstringlanczos3lanczos3, bicubic, bilinear, nearest
formatPNG and WebP preserve transparent backgrounds. JPG flattens transparency.stringsamesame, png, jpg, webp

Response

StatusBodyWhen
201sameThe run finished within 60 seconds
202Job summary JSONStill running; poll the job
4xx, 5xxError JSONSee error codes

A file response carries X-Sada-Job and X-Sada-Expires-At. For long work, post to /v1/tools/resize-image/jobs instead. See jobs and webhooks.

Also runs on the device

In the web tool and apps, Resize Image can run locally with no upload. The API always processes on the server.

Ready settings

These settings power the matching pages on the site, and work the same in the API.

Useoptions
Resize Image for Instagram Post (1080×1350){"mode":"pixels","width":1080,"height":1350,"fit":"cover"}
Resize Image for Instagram Story (1080×1920){"mode":"pixels","width":1080,"height":1920,"fit":"cover"}
Resize Image for YouTube Thumbnail (1280×720){"mode":"pixels","width":1280,"height":720,"fit":"cover"}
Resize Image for LinkedIn Banner (1584×396){"mode":"pixels","width":1584,"height":396,"fit":"cover"}
Resize Photo for WhatsApp DP (640×640){"mode":"pixels","width":640,"height":640,"fit":"cover"}
Resize Photo to Passport Size 35×45 mm{"mode":"pixels","width":413,"height":531,"fit":"cover"}
Resize Image to A4 Size{"mode":"pixels","width":2480,"height":3508,"fit":"inside"}
Resize Image for Google Play Icon (512×512){"mode":"pixels","width":512,"height":512,"fit":"cover"}
Resize Image for Google Play Feature Graphic (1024×500){"mode":"pixels","width":1024,"height":500,"fit":"cover"}
Resize Image for Apple App Store Icon (1024×1024){"mode":"pixels","width":1024,"height":1024,"fit":"cover"}
Resize Image for Snap Store Banner (1920×640){"mode":"pixels","width":1920,"height":640,"fit":"cover"}
Resize Image for Microsoft Store Logo (300×300){"mode":"pixels","width":300,"height":300,"fit":"cover"}

Try it yourself!

Pick a file, set the options and run a real request with your key. The code follows your changes.

Headers

You need a free key to run this request. Sign in and create a key.

Body

curl -X POST "https://api.sadafiles.com/v1/tools/resize-image" \  -H "X-API-Key: $SADAFILES_API_KEY" \  -F "files[]=@input.jpg" \  -o output.same

What's next?