curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/google-ads/assets/{session_asset_id}/accept \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"session_id": "9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
"campaign_id": "68b1c0d4e7b91d003c45a1f2"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/assets/{session_asset_id}/accept"
payload = {
"session_id": "9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
"campaign_id": "68b1c0d4e7b91d003c45a1f2"
}
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({
session_id: '9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f',
campaign_id: '68b1c0d4e7b91d003c45a1f2'
})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/assets/{session_asset_id}/accept', 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/{session_asset_id}/accept",
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([
'session_id' => '9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f',
'campaign_id' => '68b1c0d4e7b91d003c45a1f2'
]),
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/{session_asset_id}/accept"
payload := strings.NewReader("{\n \"session_id\": \"9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f\",\n \"campaign_id\": \"68b1c0d4e7b91d003c45a1f2\"\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/{session_asset_id}/accept")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"session_id\": \"9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f\",\n \"campaign_id\": \"68b1c0d4e7b91d003c45a1f2\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/assets/{session_asset_id}/accept")
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 \"session_id\": \"9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f\",\n \"campaign_id\": \"68b1c0d4e7b91d003c45a1f2\"\n}"
response = http.request(request)
puts response.read_body{
"accepted": true,
"session_asset_id": "b7f3a1c8-52d4-4a0e-9b31-2c6f0d8e4a19",
"asset_field_type": "SQUARE_MARKETING_IMAGE",
"kind": "image",
"source": "google",
"asset_group_count": 2,
"resource_name": "customers/1234567890/assets/98765432"
}Accept a generated Google Ads asset
Puts one generated asset onto a live Performance Max campaign.
This is the step that reaches Google Ads. Up to here creative is only a preview, and this creates the asset on the app’s own Google Ads account and links it to every asset group the campaign has, with the slot the asset was generated for. After this Google Ads is the source of truth for it.
You can accept an asset long after the generation that produced it. Base44 looks the asset up in the app’s durable library first and only falls back to the live session, so an asset you read from library works even though its preview has expired. session_id is still required, because it is what the fallback needs.
Performance Max only. Other campaign types have no asset groups, so they are rejected with a 422.
A 409 covers four different situations and the message is what tells them apart, so read it rather than retrying blindly. Waiting is right for an image that is still processing, syncing is right for a campaign that has not reached Google Ads, and regenerating is right for an asset that is no longer usable.
status before retrying.curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/google-ads/assets/{session_asset_id}/accept \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"session_id": "9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
"campaign_id": "68b1c0d4e7b91d003c45a1f2"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/assets/{session_asset_id}/accept"
payload = {
"session_id": "9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f",
"campaign_id": "68b1c0d4e7b91d003c45a1f2"
}
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({
session_id: '9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f',
campaign_id: '68b1c0d4e7b91d003c45a1f2'
})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/assets/{session_asset_id}/accept', 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/{session_asset_id}/accept",
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([
'session_id' => '9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f',
'campaign_id' => '68b1c0d4e7b91d003c45a1f2'
]),
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/{session_asset_id}/accept"
payload := strings.NewReader("{\n \"session_id\": \"9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f\",\n \"campaign_id\": \"68b1c0d4e7b91d003c45a1f2\"\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/{session_asset_id}/accept")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"session_id\": \"9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f\",\n \"campaign_id\": \"68b1c0d4e7b91d003c45a1f2\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/assets/{session_asset_id}/accept")
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 \"session_id\": \"9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f\",\n \"campaign_id\": \"68b1c0d4e7b91d003c45a1f2\"\n}"
response = http.request(request)
puts response.read_body{
"accepted": true,
"session_asset_id": "b7f3a1c8-52d4-4a0e-9b31-2c6f0d8e4a19",
"asset_field_type": "SQUARE_MARKETING_IMAGE",
"kind": "image",
"source": "google",
"asset_group_count": 2,
"resource_name": "customers/1234567890/assets/98765432"
}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
ID of the generated asset to attach, as returned in session_asset_id by Generate Google Ads assets or List Google Ads generated assets.
Body
Request shape for POST /assets/{session_asset_id}/accept.
session_id locates the transient preview in Redis; campaign_id is
the live PMax campaign whose asset groups the generated asset is
attached to. Both required — accept is the durable hand-off, so it
always targets a concrete campaign.
The generation the asset came from, as returned in session_id by Generate Google Ads assets.
"9c1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f"
The Performance Max campaign to attach the asset to, as returned in id by List campaigns.
"68b1c0d4e7b91d003c45a1f2"
Response
The asset was attached to the campaign.
The outcome of attaching a generated asset to a campaign.
Was this page helpful?