API reference

Images

API referencehttps://api.contit.cloud

Images

Endpoints for retrieving and on-the-fly resizing of image assets.

GET /images/{assetId}

Get or resize image

Retrieve an image asset, optionally manipulated on-the-fly. Sizes are capped at 5000 px per side and 12 megapixels overall; values above the cap are reduced, a request whose target exceeds the pixel budget returns 400. Source images above 50 megapixels are rejected. Results are cached per parameter combination and served with ETag, Last-Modified and Cache-Control, so repeat requests can be revalidated with a conditional GET.

Requires the ReadAccess policy

Path parameters

NameTypeRequiredDescription
assetIdstringThe asset ID (GUID) of the image

Query parameters

NameTypeRequiredDescription
widthinteger—Desired width in pixels, 0 or omitted to derive it from the height.
heightinteger—Desired height in pixels, 0 or omitted to derive it from the width.
resizeTypestring—How the image is fitted to the requested size: AspectFill (default, crops to fill), AspectFit (fits inside), Fill (stretches).
resizePositionstring—Anchor used when cropping: Center (default), Top, Bottom, Left, Right, TopLeft, TopRight, BottomLeft, BottomRight.
qualityinteger—Encoding quality, 1-100. Values outside the range are clamped. Applied to JPEG, WebP and AVIF output only.
formatstring—Convert the output format: Webp or Avif. Omit to keep the original format.
autoRotateboolean—Apply the orientation stored in the image metadata.
rotateDegreenumber—Clockwise rotation in degrees, normalized to 0-360.
flipstring—Mirror the image: Horizontal or Vertical.
filterstring—Apply a filter: BlackWhite, GreyScale, Invert, Lomograph, Polaroid, Sepia.
alphanumber—Opacity, 0-1 (0 = transparent, 1 = opaque). Out of range returns 400.
brightnessnumber—Brightness multiplier, >= 0 (0 = black, 1 = unchanged). Negative values return 400.
contrastnumber—Contrast multiplier, >= 0 (0 = flat grey, 1 = unchanged). Negative values return 400.
saturationnumber—Saturation multiplier, >= 0 (0 = greyscale, 1 = unchanged). Negative values return 400.
backgroundColorHexstring—Background color as hexadecimal (RGB, RGBA, RRGGBB or RRGGBBAA, with or without #). Anything else returns 400.
vignetteColorHexstring—Vignette color, same hexadecimal formats as backgroundColorHex.

Responses

200Success — binary image data (FileStreamResult)
(binary)binaryRaw image bytes
400Bad Request — invalid manipulation parameters (out of range value or malformed color)
401Unauthorized
404Not Found — asset does not exist or is not an image

Code examples

curl -X GET "https://api.contit.cloud/images/{assetId}" \
  -H "X-Api-Key: YOUR_API_KEY"
Example request
GET /images/c3d4e5f6-a7b8-9012-cdef-123456789012?width=300&height=200&quality=85
Example response 200
(binary image data — Content-Type: image/png)
Try it Live
GET /images/bypath/{path}

Get image by path

Retrieve an image asset by its storage path, optionally manipulated on-the-fly. Sizes are capped at 5000 px per side and 12 megapixels overall; values above the cap are reduced, a request whose target exceeds the pixel budget returns 400. Source images above 50 megapixels are rejected. Results are cached per parameter combination and served with ETag, Last-Modified and Cache-Control, so repeat requests can be revalidated with a conditional GET.

Requires the ReadAccess policy

Path parameters

NameTypeRequiredDescription
pathstringThe storage path of the image (e.g. 'products/hero-banner.jpg')

Query parameters

NameTypeRequiredDescription
widthinteger—Desired width in pixels, 0 or omitted to derive it from the height.
heightinteger—Desired height in pixels, 0 or omitted to derive it from the width.
resizeTypestring—How the image is fitted to the requested size: AspectFill (default, crops to fill), AspectFit (fits inside), Fill (stretches).
resizePositionstring—Anchor used when cropping: Center (default), Top, Bottom, Left, Right, TopLeft, TopRight, BottomLeft, BottomRight.
qualityinteger—Encoding quality, 1-100. Values outside the range are clamped. Applied to JPEG, WebP and AVIF output only.
formatstring—Convert the output format: Webp or Avif. Omit to keep the original format.
autoRotateboolean—Apply the orientation stored in the image metadata.
rotateDegreenumber—Clockwise rotation in degrees, normalized to 0-360.
flipstring—Mirror the image: Horizontal or Vertical.
filterstring—Apply a filter: BlackWhite, GreyScale, Invert, Lomograph, Polaroid, Sepia.
alphanumber—Opacity, 0-1 (0 = transparent, 1 = opaque). Out of range returns 400.
brightnessnumber—Brightness multiplier, >= 0 (0 = black, 1 = unchanged). Negative values return 400.
contrastnumber—Contrast multiplier, >= 0 (0 = flat grey, 1 = unchanged). Negative values return 400.
saturationnumber—Saturation multiplier, >= 0 (0 = greyscale, 1 = unchanged). Negative values return 400.
backgroundColorHexstring—Background color as hexadecimal (RGB, RGBA, RRGGBB or RRGGBBAA, with or without #). Anything else returns 400.
vignetteColorHexstring—Vignette color, same hexadecimal formats as backgroundColorHex.

Responses

200Success — binary image data (FileStreamResult)
(binary)binaryRaw image bytes
400Bad Request — invalid manipulation parameters (out of range value or malformed color)
401Unauthorized
404Not Found

Code examples

curl -X GET "https://api.contit.cloud/images/bypath/{path}" \
  -H "X-Api-Key: YOUR_API_KEY"
Example request
GET /images/bypath/products/hero-banner.jpg?width=800&quality=90
Example response 200
(binary image data — Content-Type: image/jpeg)
Try it Live