curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/google-ads/assets/generate-all \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel_type": "PERFORMANCE_MAX",
"final_url": "https://example.com/spring"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/assets/generate-all"
payload = {
"channel_type": "PERFORMANCE_MAX",
"final_url": "https://example.com/spring"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({channel_type: 'PERFORMANCE_MAX', final_url: 'https://example.com/spring'})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/assets/generate-all', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.base44.com/api/apps/{app_id}/google-ads/assets/generate-all",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'channel_type' => 'PERFORMANCE_MAX',
'final_url' => 'https://example.com/spring'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.base44.com/api/apps/{app_id}/google-ads/assets/generate-all"
payload := strings.NewReader("{\n \"channel_type\": \"PERFORMANCE_MAX\",\n \"final_url\": \"https://example.com/spring\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.base44.com/api/apps/{app_id}/google-ads/assets/generate-all")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel_type\": \"PERFORMANCE_MAX\",\n \"final_url\": \"https://example.com/spring\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/assets/generate-all")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channel_type\": \"PERFORMANCE_MAX\",\n \"final_url\": \"https://example.com/spring\"\n}"
response = http.request(request)
puts response.read_body{
"session_id": "9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
"text": [],
"images": [],
"background_image_count": 3,
"language": "de"
}Generate Google Ads assets
Writes ad copy and generates pictures for the app in one call, and returns them as previews.
Nothing reaches Google Ads here. Everything comes back as a preview you look at first, and only Accept a generated Google Ads asset puts one on a live campaign.
Which slots get filled follows channel_type. SEARCH gets HEADLINE and DESCRIPTION copy plus landscape and square pictures. DISPLAY gets the same pictures and adds LONG_HEADLINE copy. PERFORMANCE_MAX and DEMAND_GEN get that copy plus all four picture shapes, adding portrait and tall portrait. You cannot ask for individual slots on this endpoint.
The copy is written in language_code when you send it, and otherwise in the language of the app’s own site. The response reports which one in language.
Pictures take longer than copy, so the response returns as soon as the copy is ready. images holds only the pictures that finished in time and background_image_count says how many more are coming. Poll List Google Ads generated assets with the returned session_id for the rest.
session_id with text and images empty, and with background_image_count and language absent. That absence is how you tell it apart from a generation that genuinely produced nothing, and the right response is to poll the session_id you were given rather than to retry.Rate limits are per app and split across two pools. The copy costs 2 of 20 requests a minute. The pictures cost one of 30 requests a minute for each picture shape, so a PERFORMANCE_MAX call costs 4 and a SEARCH call costs 2. For PERFORMANCE_MAX the picture pool runs out first, which puts the ceiling at about seven calls a minute. A leg that has nothing to do costs nothing. Each leg can also retry once, as below, and the retry costs that leg the same again.
text and images rather than assuming a 200 means both ran.curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/google-ads/assets/generate-all \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"channel_type": "PERFORMANCE_MAX",
"final_url": "https://example.com/spring"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/assets/generate-all"
payload = {
"channel_type": "PERFORMANCE_MAX",
"final_url": "https://example.com/spring"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({channel_type: 'PERFORMANCE_MAX', final_url: 'https://example.com/spring'})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/assets/generate-all', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.base44.com/api/apps/{app_id}/google-ads/assets/generate-all",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'channel_type' => 'PERFORMANCE_MAX',
'final_url' => 'https://example.com/spring'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.base44.com/api/apps/{app_id}/google-ads/assets/generate-all"
payload := strings.NewReader("{\n \"channel_type\": \"PERFORMANCE_MAX\",\n \"final_url\": \"https://example.com/spring\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.base44.com/api/apps/{app_id}/google-ads/assets/generate-all")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel_type\": \"PERFORMANCE_MAX\",\n \"final_url\": \"https://example.com/spring\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/assets/generate-all")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channel_type\": \"PERFORMANCE_MAX\",\n \"final_url\": \"https://example.com/spring\"\n}"
response = http.request(request)
puts response.read_body{
"session_id": "9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
"text": [],
"images": [],
"background_image_count": 3,
"language": "de"
}Authorizations
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
Path Parameters
Body
Request shape for POST /assets/generate-all — one-shot text + images.
Excludes LONG_HEADLINE for SEARCH at the boundary (Google rejects it
server-side; we surface the friendlier error). final_url is the
primary input; the orchestrator builds a freeform_prompt from
build_site_context(app_id) automatically.
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. Sending it always starts a new generation, even while one is running for the app, so poll List generated assets for progress rather than calling this again.
"3f9c2a7b8d1e4f6a9b0c1d2e3f4a5b6c"
Response
The creative that was generated.
The creative one generation produced.
ID of this generation. Pass it as session_id to List Google Ads generated assets to poll for the images that are still coming.
"9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f"
How many more pictures are still being generated for this session. The response comes back as soon as the copy is done, so poll List Google Ads generated assets with session_id for these. The field is absent when a generation for this app was already running, which is how you tell that case apart.
3
Was this page helpful?