About this endpoint
What it does
Crops an image fetched from a URL and returns a signed URL for the cropped result. Use either dimension mode with url plus width and height, or margin mode with image_url plus top, bottom, left, and right.
Query Parameter(s)
| Attribute | Type | Mandatory | Description |
|---|---|---|---|
| width | Integer | Yes (if url is used) | Positive integer. Used in dimension mode to define the crop box width from the top-left origin. |
| height | Integer | Yes (if url is used) | Positive integer. Used in dimension mode to define the crop box height from the top-left origin. |
| output | String | No | Output filename base. |
| preserve_format | Boolean | No | Default: false. Preserves the source image format when set. |
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| top | String | Yes (if image_url is used) | Top edge inset for margin mode. Use a string such as 10px or 10%. |
| url | String | Yes (if width and height are used) | Image URL for dimension mode. Use this to crop by width and height. Do not combine with image_url. |
| left | String | Yes (if image_url is used) | Left edge inset for margin mode. Use a string such as 5px or 5%. |
| right | String | Yes (if image_url is used) | Right edge inset for margin mode. Use a string such as 5px or 5%. |
| bottom | String | Yes (if image_url is used) | Bottom edge inset for margin mode. Use a string such as 10px or 10%. |
| image_url | String | Yes (if top, bottom, left, and right are used) | Image URL for margin mode. Use this with the four inset fields. Do not combine with url. |
Response
Returns a JSON object with a data string field — a time-limited pre-signed URL to the stored cropped image. The response schema declares this field as always present on a successful response.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| data | String | Yes | Time-limited pre-signed URL to the stored cropped image. Always present on a 200 response. |