Image Editing

Crop and reframe images with precise pixel or aspect-ratio controls.


POST/api/v1/image/edit

Request Body

ParameterTypeRequiredDescription
operationstringYes"imageCrop"
mediaIdsstring[]Yes1 media ID of the image to crop

imageCrop

Crop an image by specifying pixel coordinates, an aspect ratio, or both.

ParameterTypeRequiredDescription
cropPixelXintegerNoX coordinate of the crop origin
cropPixelYintegerNoY coordinate of the crop origin
cropPixelWidthintegerNoWidth of the crop area in pixels
cropPixelHeightintegerNoHeight of the crop area in pixels
aspectRatiostringNo16:9, 9:16, 1:1, 4:5, 21:9, 4:3, 3:2, free (default free)

Response

{
  "editorJobId": "ej_..."
}

Example

POST/api/v1/image/edit
{
  "operation": "imageCrop",
  "mediaIds": ["media_abc"],
  "params": {
    "aspectRatio": "1:1",
    "cropPixelX": 100,
    "cropPixelY": 50,
    "cropPixelWidth": 500,
    "cropPixelHeight": 500
  }
}