Contentstack introduces the Agentic Experience Platform | Press release
Contentstack introduces the Agentic Experience Platform | Press release
Contentstack.comAcademyLogin
CS-log-dark.svgCS-log-dark.svg
  • Changelog
  • APIs
  • SDKs
  • Solution Center
  • Marketplace
  • Changelog
  • Developers & IT
  • Business users
  • Digital leaders
  • Developer Fast Track
  • Plans & Pricing
  • Retail
  • Travel and tourism
  • Financial services
  • Technology
  • Manufacturing
  • E-commerce
  • Localization
  • Personalization
  • Portals and knowledge bases
  • Academy
  • Docs
  • Product updates
  • Contentstack on Contentstack
  • Blog
  • Insights and analyst reports
  • Webinars
  • Podcasts
  • Glossary
  • Content generative library
  • Community
  • Headless CMS
  • Composable AXP
  • Personalization
  • CDP
  • Case Studies
  • Customer Care
  • Contentstack Experience Awards
  • Customer support
  • Overview
  • Find a partner
  • Login
  • About us
  • News
  • Customer support portal
  • Contact
  • Facebook
  • LinkedIn
  • Instagram
  • Github
  • Youtube
  • Discord
  • X

Platform

  • Solution Center
  • Marketplace
  • Changelog
  • Developers & IT
  • Business users
  • Digital leaders
  • Developer Fast Track
  • Plans & Pricing

Solutions

  • Retail
  • Travel and tourism
  • Financial services
  • Technology
  • Manufacturing
  • E-commerce
  • Localization
  • Personalization
  • Portals and knowledge bases

Resources

  • Academy
  • Docs
  • Product updates
  • Contentstack on Contentstack
  • Blog
  • Insights and analyst reports
  • Webinars
  • Podcasts
  • Glossary
  • Content generative library
  • Community
  • Headless CMS
  • Composable AXP
  • Personalization
  • CDP

Customers

  • Case Studies
  • Customer Care
  • Contentstack Experience Awards
  • Customer support

Partners

  • Overview
  • Find a partner
  • Login

Company

  • About us
  • News
  • Customer support portal
  • Contact

Social

  • Facebook
  • LinkedIn
  • Instagram
  • Github
  • Youtube
  • Discord
  • X
LegalTermsPrivacyTrust Center

Cookie settings

Copyright © 2026 Contentstack Inc. All rights reserved.

AI Assistant

Ask a question below...

infoAI responses may contain mistakes.
/
  1. Home
  2. APIs
  3. Image Delivery API
  4. Fit Mode

Fit Mode

markdownView as Markdown

This parameter enables you to fit the given image properly within the specified height and width. You need to provide values for the height, width and fit parameters. The available values for the fit parameter are bounds, cover and crop.

Fit to bounds

GEThttps://images.contentstack.io/v3/assets/{stack_api_key}/{asset_uid}/{file_uid}/filename.jpg?environment={environment_name}&width={width_value}&height={height_value}&fit={fit_value}

Note Check out the limitations that are applicable here.

If fit is set to bounds, it will constrain the given image into the specified height and width.

Fit to cover

GEThttps://images.contentstack.io/v3/assets/{stack_api_key}/{asset_uid}/{file_uid}/filename.jpg?environment={environment_name}&width={width_value}&height={height_value}&fit={fit_value}

NoteThe fit parameter requires both the height and the width parameters.

If fit is set to cover, it resizes the image (shrinks or enlarges) to fill the entire area defined by the width and height parameters. If the image's aspect ratio differs from the specified dimensions, it will be cropped centrally to fit.

Fit by cropping

GEThttps://images.contentstack.io/v3/assets/{stack_api_key}/{asset_uid}/{file_uid}/filename.jpg?environment={environment_name}&width={width_value}&height={height_value}&fit={fit_value}
Additional Notes
  1. The fit parameter requires both the height and the width parameters.

Note Check out the limitations that are applicable here.

If fit is set to crop, it will crop the given image to the defined height and width.

Hide Parameters

Query Parameters

heightoptionalstring

Enter the value of the image height in pixels or percentage. Example 250 or 0.50 

Example:

0.50
fitoptionalstring

Enter either bounds or crop as value. Example bounds

Example:

bounds
widthoptionalstring

Enter the value of the image width in pixels or percentage. Example 250 or 0.50

Example:

0.50
environmentrequiredstring

Enter the environment scoped to your delivery token.

Example:

production
Hide Parameters

Query Parameters

widthoptionalstring

Enter the value of the image width in pixels or percentage. Example 250 or 0.50

Example:

250
heightoptionalstring

Enter the value of the image height in pixels or percentage. Example 250 or 0.50

Example:

250
fitoptionalstring

Pass the fit value as cover to resize the image to entirely cover the specified region, making one dimension larger if needed.

Example:

cover
environmentrequiredstring

Enter the environment scoped to your delivery token.

Example:

production
Hide Parameters

Query Parameters

widthoptionalstring

Enter the value of the image width in pixels or percentage. Example 250 or 0.50

Example:

250
heightoptionalstring

Enter the value of the image height in pixels or percentage. Example 250 or 0.50

Example:

250
fitoptionalstring

Enter either bounds or crop as value. Example crop

Example:

crop
environmentrequiredstring

Enter the environment scoped to your delivery token.

Example:

production