Skip to main content
POST
Generate Google Ads image assets

Authorizations

api_key
string
header
required

Personal API key.

Path Parameters

app_id
string
required

ID of the app whose Google Ads creative you want to generate or read.

Body

application/json
channel_type
string
default:PERFORMANCE_MAX

Campaign type the pictures are for, one of PERFORMANCE_MAX, DEMAND_GEN, SEARCH or DISPLAY. It does not restrict the shapes you may ask for.

Example:

"PERFORMANCE_MAX"

asset_field_types
string[]

Which picture shapes to generate, from MARKETING_IMAGE, SQUARE_MARKETING_IMAGE, PORTRAIT_MARKETING_IMAGE or TALL_PORTRAIT_MARKETING_IMAGE. Send between one and four entries. Each shape costs one request against the picture rate limit, so asking for fewer gets you more calls a minute. A text field type here is rejected with a 422.

One of MARKETING_IMAGE, SQUARE_MARKETING_IMAGE, PORTRAIT_MARKETING_IMAGE or TALL_PORTRAIT_MARKETING_IMAGE.

Example:
final_url
string

Page to base the pictures on. Send exactly one of this and freeform_prompt.

Example:

"https://example.com/spring"

freeform_prompt
string

What the pictures should show, in your own words, up to 1500 characters. Send exactly one of this and final_url.

Example:

"Warm studio shots of handmade oak dining tables"

Response

The pictures that were generated.

The pictures one image generation produced.

session_id
string
required

ID of this generation. Pass it as session_id to List Google Ads generated assets to collect the pictures that are still coming.

Example:

"9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f"

assets
GeneratedAssetSummary · object[]
required

The pictures that finished in time to be returned inline. Empty when nothing landed in time, when the engine produced nothing, and when a generation for this app was already running, which in_flight tells apart.

Example:
background_pending
boolean | null

Present and true when more pictures are still being generated under this session_id, including when assets came back empty because the first one took too long. Absent on a lock-miss response.

Example:

true

background_count
integer | null

How many more pictures are still being generated. Absent on a lock-miss response.

Example:

3

in_flight
boolean | null

Present and true only when an image generation for this app was already running, in which case session_id is that run's and assets is empty. Poll the returned session_id rather than retrying. The field is absent on every other response.

Example:

true