Skip to main content
POST
Generate Google Ads text assets

Authorizations

Authorization
string
header
required

Personal access token, sent as Authorization: Bearer <token>. Each operation lists the permission it needs: read_only or full_access. A full-access token can call every operation. A read-only token can call only the operations that list read_only; anything else returns 403 read_only_credential_route_not_allowed.

Scopes

full_access
PersonalAccessTokenAuth
google_ads:manage
WorkspaceApiKeyAuth
full_access
WorkspaceApiKeyAuth
google_ads:manage
WorkspaceApiKeyBearerAuth
full_access
WorkspaceApiKeyBearerAuth

Path Parameters

app_id
string
required

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

Body

application/json

Request shape for POST /assets/generate-text.

Both final_url and freeform_prompt may be present — text generation is NOT XOR (Google's own example sends both). keywords is optional; when supplied, must be 1–15 non-empty entries.

channel_type
enum<string>
default:PERFORMANCE_MAX

Campaign type the copy is for, one of PERFORMANCE_MAX, DEMAND_GEN, SEARCH or DISPLAY.

Available options:
SEARCH,
PERFORMANCE_MAX,
DISPLAY,
DEMAND_GEN
Example:

"PERFORMANCE_MAX"

asset_field_types
enum<string>[]

Which kinds of line to write, from HEADLINE, LONG_HEADLINE or DESCRIPTION. Send between one and three entries. An image field type here is rejected with a 422.

Required array length: 1 - 3 elements
Available options:
HEADLINE,
LONG_HEADLINE,
DESCRIPTION,
MARKETING_IMAGE,
SQUARE_MARKETING_IMAGE,
PORTRAIT_MARKETING_IMAGE,
TALL_PORTRAIT_MARKETING_IMAGE
Example:
final_url
string | null

Page to base the copy on. Unlike image generation you may send this together with freeform_prompt, and sending neither grounds the copy in the app's own home page.

Example:

"https://example.com/spring"

freeform_prompt
string | null

What the copy should say, in your own words, up to 1500 characters.

Maximum string length: 1500
Example:

"Lead with free delivery across Germany"

keywords
string[]

Keywords to work into the copy. Send between 1 and 15 of them, and none of them blank. Omit the field entirely rather than sending an empty list.

Required array length: 1 - 15 elements
Example:
session_id
string | null

The session_id of an earlier generation to add these previews to. List Google Ads generated assets returns the combined set for an hour. Omit it to start a new generation.

Example:

"3f9c2a7b8d1e4f6a9b0c1d2e3f4a5b6c"

campaign_id
string | null

The id of a campaign from List campaigns whose language to write in when you don't send language_code. Nothing is attached to the campaign.

Example:

"6886b8d390dc7e2f4a2c91b3"

language_code
string | null

Two-letter code of the language to write the copy in, for example de. A regional tag such as pt-BR is reduced to pt. Omit it to use the campaign's language when you send campaign_id, and otherwise the language of the app's own site. A language Google Ads doesn't support returns a 400.

Example:

"de"

single_asset
boolean
default:false

Set to true for a quick replacement of one line. The copy comes back in seconds and counts as one copy request instead of two, at somewhat lower quality. Several lines can still come back, so use the first.

Example:

true

Response

The copy that was generated.

The copy one text generation produced.

session_id
string
required

ID of this generation. Pass it as session_id to List Google Ads generated assets, or to Accept a generated Google Ads asset with one of the returned session_asset_id values.

Example:

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

assets
GeneratedAssetSummary · object[]
required

The copy that was generated, one entry per line. Empty when the engine produced nothing and when a generation for this app was already running, which in_flight tells apart.

Example:
language
string | null

Language the copy was written in, as a lowercase two-letter code: language_code when you sent it, then the campaign's language when you sent campaign_id, and otherwise the language of the app's own site. The field is absent on a lock-miss response unless you sent language_code or campaign_id.

Example:

"de"

in_flight
boolean | null

Present and true only when a text 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