v7

latestOpenAPI 3.0.22026-08-08114248430.1 KB
generate

Reframe a source image to a target size, by asset id or by uploaded bytes

Reframe a source image to a target size.

Supply the source image as either an AssetIdentifier reference (image_asset_identifier) or the raw image bytes directly (image, multipart requests only) -- callers are never required to call POST /v2/assets first. Provide exactly one of the two; supplying both, or neither, is rejected with a 400.

The target resolution (WIDTHxHEIGHT) sets the exact output dimensions and selects the reframing layout, so it is required.

The model is fixed by the route, so no model field is accepted.

The request blocks until the reframed image(s) are ready and returns them directly in the response.

post/v1/ad-resizer

Request body

imagestring binary

The source image to reframe (max size 10MB), as raw bytes; only JPEG, PNG, and WEBP formats are supported. Multipart requests only. Provide exactly one of image_asset_identifier or image.

resolution'300x250' | '336x280' | '300x600' | '1080x1080' | '1080x1350' | '1080x1920' | '1920x1080' | '728x90' | '160x600' | '970x250' | '320x50' | '300x50' | '320x100' | '1800x900' | '2400x2400' | '1200x3500' required

Target ad resolution, formatted as WIDTHxHEIGHT. Must be one of the supported ad resolutions listed above; any other value is rejected with a 400. Each returned image has exactly these pixel dimensions.

promptstring

Optional edit instruction to apply while reframing, for example "remove the logo" or "put the price bottom-right".

quality'LOW' | 'MEDIUM' | 'HIGH'
num_imagesinteger

The number of reframed variations to generate.

store_assetsboolean

Reserved for a future release: accepted for forward compatibility but not yet applied. Resulting assets are not stored to your account regardless of this value.

Example request

{
  "image_asset_identifier": {
    "asset_type": "RESPONSE",
    "asset_id": "7uS_VESkRI6O3-sVgHQp_A"
  }
}

Response

The reframed image(s).

createdstring date-time required

The time the request was created.

Example response

{
  "data": [
    {
      "url": "https://openapi-generator.tech",
      "is_image_safe": true
    },
    {
      "url": "https://openapi-generator.tech",
      "is_image_safe": true
    }
  ],
  "created": "2000-01-23T04:56:07+00:00"
}