curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}/recommendations/apply-budget \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"recommendation_resource_name": "customers/1234567890/recommendations/AbC123",
"recommended_daily_budget_micros": 45000000,
"recommendation_type": "CAMPAIGN_BUDGET"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}/recommendations/apply-budget"
payload = {
"recommendation_resource_name": "customers/1234567890/recommendations/AbC123",
"recommended_daily_budget_micros": 45000000,
"recommendation_type": "CAMPAIGN_BUDGET"
}
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({
recommendation_resource_name: 'customers/1234567890/recommendations/AbC123',
recommended_daily_budget_micros: 45000000,
recommendation_type: 'CAMPAIGN_BUDGET'
})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}/recommendations/apply-budget', 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/campaigns/{campaign_id}/recommendations/apply-budget",
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([
'recommendation_resource_name' => 'customers/1234567890/recommendations/AbC123',
'recommended_daily_budget_micros' => 45000000,
'recommendation_type' => 'CAMPAIGN_BUDGET'
]),
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/campaigns/{campaign_id}/recommendations/apply-budget"
payload := strings.NewReader("{\n \"recommendation_resource_name\": \"customers/1234567890/recommendations/AbC123\",\n \"recommended_daily_budget_micros\": 45000000,\n \"recommendation_type\": \"CAMPAIGN_BUDGET\"\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/campaigns/{campaign_id}/recommendations/apply-budget")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"recommendation_resource_name\": \"customers/1234567890/recommendations/AbC123\",\n \"recommended_daily_budget_micros\": 45000000,\n \"recommendation_type\": \"CAMPAIGN_BUDGET\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}/recommendations/apply-budget")
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 \"recommendation_resource_name\": \"customers/1234567890/recommendations/AbC123\",\n \"recommended_daily_budget_micros\": 45000000,\n \"recommendation_type\": \"CAMPAIGN_BUDGET\"\n}"
response = http.request(request)
puts response.read_body{
"id": "68b1c0d4e7b91d003c45a1f2",
"daily_budget_micros": 45000000,
"already_applied": true
}Apply a Google Ads budget recommendation
Applies a Google Ads budget recommendation to a campaign, raising what it can spend per day.
Take recommendation_resource_name, recommended_daily_budget_micros and recommendation_type from a suggestion returned by List campaign optimization suggestions whose recommendation_type is CAMPAIGN_BUDGET.
You do not choose the amount. Base44 re-reads the recommendation from Google and applies Google’s current figure. recommended_daily_budget_micros is the amount you are confirming, not a value to set: if Google’s figure has changed since you read the suggestion, the call is rejected with a 409 so nobody raises a budget to a number they never saw. Read the suggestions again and resend.
This changes real spend. Applying the same recommendation twice is safe: the second call changes nothing and returns already_applied set to true.
Some recommendations cover a budget shared by several campaigns. Applying one raises the budget for all of them, so Base44 rejects it with a 409 unless every campaign it touches is one you manage here.
While Google is still learning a campaign (its first 7 days of learning, or while Google reports a learning bidding status), a raise would restart that learning, so the call is rejected with a 409. Changing the budget yourself is still allowed.
curl --request POST \
--url https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}/recommendations/apply-budget \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"recommendation_resource_name": "customers/1234567890/recommendations/AbC123",
"recommended_daily_budget_micros": 45000000,
"recommendation_type": "CAMPAIGN_BUDGET"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}/recommendations/apply-budget"
payload = {
"recommendation_resource_name": "customers/1234567890/recommendations/AbC123",
"recommended_daily_budget_micros": 45000000,
"recommendation_type": "CAMPAIGN_BUDGET"
}
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({
recommendation_resource_name: 'customers/1234567890/recommendations/AbC123',
recommended_daily_budget_micros: 45000000,
recommendation_type: 'CAMPAIGN_BUDGET'
})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}/recommendations/apply-budget', 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/campaigns/{campaign_id}/recommendations/apply-budget",
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([
'recommendation_resource_name' => 'customers/1234567890/recommendations/AbC123',
'recommended_daily_budget_micros' => 45000000,
'recommendation_type' => 'CAMPAIGN_BUDGET'
]),
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/campaigns/{campaign_id}/recommendations/apply-budget"
payload := strings.NewReader("{\n \"recommendation_resource_name\": \"customers/1234567890/recommendations/AbC123\",\n \"recommended_daily_budget_micros\": 45000000,\n \"recommendation_type\": \"CAMPAIGN_BUDGET\"\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/campaigns/{campaign_id}/recommendations/apply-budget")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"recommendation_resource_name\": \"customers/1234567890/recommendations/AbC123\",\n \"recommended_daily_budget_micros\": 45000000,\n \"recommendation_type\": \"CAMPAIGN_BUDGET\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}/recommendations/apply-budget")
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 \"recommendation_resource_name\": \"customers/1234567890/recommendations/AbC123\",\n \"recommended_daily_budget_micros\": 45000000,\n \"recommendation_type\": \"CAMPAIGN_BUDGET\"\n}"
response = http.request(request)
puts response.read_body{
"id": "68b1c0d4e7b91d003c45a1f2",
"daily_budget_micros": 45000000,
"already_applied": true
}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.
Path Parameters
Base44's ID for the campaign, as returned in id by List campaigns. This is not the Google Ads campaign ID, which is reported separately as google_campaign_id.
Body
Request shape for the user-approved budget-recommendation apply.
recommendation_resource_name is Google's customers/.../recommendations/...
id (used for idempotency + server-side re-resolution). The route re-fetches
the recommendation from Google and applies Google's own recommended amount
for the recommendation's target campaign, so the request body amount is
advisory only (what the user saw) and a tampered value can't change what is
applied. It is still bounds-checked by update_campaign_budget.
Response
The campaign's budget after the change.
The campaign's budget after applying Google's recommendation.
Was this page helpful?