apyhub
FILE MANIPULATION · IMAGE PROCESSING

Resize Images API

Hosted on ApyHub

What it does

Image Resizer lets you resize an image by sending either a binary file upload or an image URL, then returns the resized result as a file or a signed download link.

Use width and height to set the target dimensions. You can also pass output to name the generated file, preserve_format to keep the original image format, and auto_orientation to apply orientation metadata before resizing. The upload-based endpoints accept an image binary in the request body. The URL-based endpoints accept a url in the body.

Choose the response shape that fits your workflow. The /download endpoints return the resized image as binary data, which is useful when you want to stream the result directly into your app or storage layer. The /link endpoints return a JSON object with a data URI, which is better when you want to hand off a temporary download link to another service or client.

Use Image Resizer for thumbnails, product image variants, email assets, or any workflow where images need to be normalized to a fixed size before publishing or further processing.

▣ ENDPOINT 01 / 04
POST
Resize image (multipart upload, download file)
http://localhost:8080/apyhub/resize-image/multi-part/download
QUICKSTARTGUIDE

Quickstart

Download a resized version of an image by sending the source file and required dimensions as multipart form data.

curl -X POST "http://localhost:8080/apyhub/resize-image/multi-part/download?width=800&height=600" \
  -H "apy-token: $APY_TOKEN" \
  -F "image=@/path/to/image.jpg"

What you'll get back

Returns a binary file (string with format: binary) containing the downloaded resized image.

...binary image data...
TRY ITLIVE · 30 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*

About this endpoint

What it does

Resizes an uploaded image using multipart form data and returns the resized file as binary output. The resize dimensions are provided as query parameters, with optional controls for output naming, format preservation, and auto-orientation.

Query Parameter(s)

AttributeTypeMandatoryDescription
widthIntegerYesResize width in pixels. Minimum: 1.
heightIntegerYesResize height in pixels. Minimum: 1.
outputStringNoOutput name.
preserve_formatBooleanNoWhether to preserve the original image format.
auto_orientationBooleanNoWhether to auto-orient the image.

Request Body

ParameterTypeMandatoryDescription
imageStringYesImage file to resize. Binary upload.

Response

Returns a binary file response containing the resized image. The output schema is a single binary string, so there is no JSON wrapper or response fields to map.

Notes

This endpoint returns the resized image as a file rather than JSON, so callers should handle the response as binary data.

Query parameters

Name
Type
Description
widthREQUIRED
integer
heightREQUIRED
integer
outputOPTIONAL
string
preserve_formatOPTIONAL
boolean
auto_orientationOPTIONAL
boolean

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 02 / 04
POST
Resize image (multipart upload, signed URL)
http://localhost:8080/apyhub/resize-image/multi-part/link
QUICKSTARTGUIDE

Quickstart

Resize an image from a linked file by sending the image file plus the required width and height as multipart form fields.

curl -X POST "http://localhost:8080/apyhub/resize-image/multi-part/link?width=800&height=600" \
  -H "apy-token: $APY_TOKEN" \
  -F "image=@/path/to/image.jpg"

What you'll get back

Returns a JSON object with a data string field containing the resulting file URL.

{
  "data": "https://example.com/resized-image.jpg"
}
TRY ITLIVE · 30 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*

About this endpoint

What it does

Resizes an uploaded image and returns a signed URL for the generated result. The request sends the source image as multipart form data and passes resizing options through query parameters.

Query Parameter(s)

AttributeTypeMandatoryDescription
widthIntegerYesTarget width in pixels. Minimum: 1.
heightIntegerYesTarget height in pixels. Minimum: 1.
outputStringNoOutput identifier. Example: my-invite.
preserve_formatBooleanNoWhether to keep the original image format.
auto_orientationBooleanNoWhether to apply automatic orientation handling.

Request Body

ParameterTypeMandatoryDescription
imageStringYesImage file to upload as binary multipart form data.

Response

Returns a JSON object with a data string field containing a URI for the resized image output.

ParameterTypeMandatoryDescription
dataStringYesSigned URL returned by the service. This field is a URI.

Query parameters

Name
Type
Description
widthREQUIRED
integer
heightREQUIRED
integer
outputOPTIONAL
string
preserve_formatOPTIONAL
boolean
auto_orientationOPTIONAL
boolean

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 03 / 04
POST
Resize image (fetch by URL, download file)
http://localhost:8080/apyhub/resize-image/url/download
QUICKSTARTGUIDE

Quickstart

Resize an image from a URL using the required width and height query parameters, and send the source URL in the JSON body.

curl -X POST "http://localhost:8080/apyhub/resize-image/url/download?width=800&height=600" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.jpg"}'

What you'll get back

Returns the resized image as binary.

TRY ITLIVE · 30 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Resize URL mode — provide `url`.

About this endpoint

What it does

Resizes an image fetched from a source URL and returns the resized file as binary data. You provide the image URL in the request body and specify the target width and height as query parameters.

Query Parameter(s)

AttributeTypeMandatoryDescription
widthIntegerYesTarget image width. Minimum: 1.
heightIntegerYesTarget image height. Minimum: 1.
outputStringNoOutput name.
preserve_formatBooleanNoPreserves the source image format when set.
auto_orientationBooleanNoApplies automatic orientation handling when set.

Request Body

ParameterTypeMandatoryDescription
urlStringYesSource image URL. Format: URI.

Response

Returns a binary file containing the resized image.

ParameterTypeMandatoryDescription
binaryStringYesBinary response body representing the resized image file.

Query parameters

Name
Type
Description
widthREQUIRED
integer
heightREQUIRED
integer
outputOPTIONAL
string
preserve_formatOPTIONAL
boolean
auto_orientationOPTIONAL
boolean

Body

Name
Type
Description
bodyREQUIRED
object
Resize URL mode — provide `url`.
▣ ENDPOINT 04 / 04
POST
Resize image (fetch by URL, signed URL)
http://localhost:8080/apyhub/resize-image/url/link
QUICKSTARTGUIDE

Quickstart

Resize an image from a URL by sending the source URL in the JSON body and the target dimensions as query parameters.

curl -X POST "http://localhost:8080/apyhub/resize-image/url/link?width=800&height=600" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.jpg"}'

What you'll get back

Returns a JSON object with a data string field containing a URI for the resized image.

{
  "data": "https://..."
}
TRY ITLIVE · 30 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Resize URL mode — provide `url`.

About this endpoint

What it does

Resizes an image fetched from a URL or signed URL and returns the resized image as a URI in the data field. The target size is controlled by the width and height query parameters.

Query Parameter(s)

AttributeTypeMandatoryDescription
widthIntegerYesOutput image width. Minimum: 1.
heightIntegerYesOutput image height. Minimum: 1.
outputStringNoOutput name.
preserve_formatBooleanNoPreserve the original image format.
auto_orientationBooleanNoAutomatically apply image orientation metadata.

Request Body

ParameterTypeMandatoryDescription
urlStringYesImage URL to resize. Must be a valid URI.

Response

Returns a JSON object with a data string field formatted as a URI. This field contains the URI of the resized image. The success response is an object with one top-level field: data (string).

ParameterTypeMandatoryDescription
dataStringYesURI of the resized image.

Query parameters

Name
Type
Description
widthREQUIRED
integer
heightREQUIRED
integer
outputOPTIONAL
string
preserve_formatOPTIONAL
boolean
auto_orientationOPTIONAL
boolean

Body

Name
Type
Description
bodyREQUIRED
object
Resize URL mode — provide `url`.
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.