ad-images
Ad Images

Resize Primary Image

Resize the primary ad image to a different aspect ratio.

Uses Saphire's edit flow to regenerate the image in the target aspect ratio while preserving visual content. Creates a new AdImage record linked to the same ad.

Constraints:

  • Source image must be the primary (square) image
  • Target aspect ratio must be portrait or landscape
  • Target aspect ratio cannot already exist for this ad

Request:

  • ad_image_id: Source image to resize (must be square/primary)
  • target_aspect_ratio: Target aspect ratio (portrait or landscape)

Returns:

  • Source and resized image details

Credits: Consumes 1 credit per resize operation.

post/api/v1/ad-images/resize-primary

Request

  • Base URL: https://api.trylapis.com (the document declares no server; this is the origin it was published from)
  • URL: https://api.trylapis.com/api/v1/ad-images/resize-primary
  • Auth: HTTP bearer

Query parameters

client_user_idinteger nullable

Client user ID to view data for

Headers

x-lapis-dev-tokenstring nullable
x-assume-user-idinteger nullable

Request body

ad_image_idinteger required

ID of the source AdImage to resize (must be square)

target_aspect_ratio'square' | 'portrait' | 'landscape' | '1:1' | '2:3' | '3:2' | '3:4' | '4:3' | '4:5' | '5:4' | '9:16' | '16:9' | '21:9' required

Supported aspect ratios for ad images.

Response

Successful Response

successboolean required
messagestring required

Changes

No recorded changes to this operation across all 1 revision of this API.