curl --request PATCH \
--url https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/bulk-budget \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"updates": [
{
"campaign_id": "68b1c0d4e7b91d003c45a1f2",
"daily_budget_micros": 15000000
},
{
"campaign_id": "68b1c0d4e7b91d003c45a1f4",
"daily_budget_micros": 8000000
}
]
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/bulk-budget"
payload = { "updates": [
{
"campaign_id": "68b1c0d4e7b91d003c45a1f2",
"daily_budget_micros": 15000000
},
{
"campaign_id": "68b1c0d4e7b91d003c45a1f4",
"daily_budget_micros": 8000000
}
] }
headers = {
"api_key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {api_key: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
updates: [
{campaign_id: '68b1c0d4e7b91d003c45a1f2', daily_budget_micros: 15000000},
{campaign_id: '68b1c0d4e7b91d003c45a1f4', daily_budget_micros: 8000000}
]
})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/bulk-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/bulk-budget",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'updates' => [
[
'campaign_id' => '68b1c0d4e7b91d003c45a1f2',
'daily_budget_micros' => 15000000
],
[
'campaign_id' => '68b1c0d4e7b91d003c45a1f4',
'daily_budget_micros' => 8000000
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_key: <api-key>"
],
]);
$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/bulk-budget"
payload := strings.NewReader("{\n \"updates\": [\n {\n \"campaign_id\": \"68b1c0d4e7b91d003c45a1f2\",\n \"daily_budget_micros\": 15000000\n },\n {\n \"campaign_id\": \"68b1c0d4e7b91d003c45a1f4\",\n \"daily_budget_micros\": 8000000\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("api_key", "<api-key>")
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.patch("https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/bulk-budget")
.header("api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"updates\": [\n {\n \"campaign_id\": \"68b1c0d4e7b91d003c45a1f2\",\n \"daily_budget_micros\": 15000000\n },\n {\n \"campaign_id\": \"68b1c0d4e7b91d003c45a1f4\",\n \"daily_budget_micros\": 8000000\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/bulk-budget")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"updates\": [\n {\n \"campaign_id\": \"68b1c0d4e7b91d003c45a1f2\",\n \"daily_budget_micros\": 15000000\n },\n {\n \"campaign_id\": \"68b1c0d4e7b91d003c45a1f4\",\n \"daily_budget_micros\": 8000000\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"succeeded": [
"68b1c0d4e7b91d003c45a1f2"
],
"failed": [
{
"campaign_id": "68b1c0d4e7b91d003c45a1f4",
"reason": "Budget below the minimum for this currency"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Bulk update Google Ads campaign budgets
Changes the daily budget on several campaigns in one call.
Send one entry per campaign in updates, each with a campaign_id and a daily_budget_micros. Budgets are absolute, not deltas, and are in micros of the account currency.
Each entry is applied on its own and this is not atomic. The response lists the campaigns that were updated in succeeded and the ones that were not in failed, each with a reason. A partially applied call still returns a 200, so check failed rather than relying on the status code. Re-sending an entry is safe, because the budget is set to the value you send rather than added to it.
failed usually means the budget did not change, but it can also mean Google accepted the new budget and only Base44’s own record of it failed to save. In that case the campaign is already spending at the new budget. Read the campaign back with Get campaign before you treat a failed entry as unchanged.Each reason is free text meant for a person to read. Do not branch on it.
curl --request PATCH \
--url https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/bulk-budget \
--header 'Content-Type: application/json' \
--header 'api_key: <api-key>' \
--data '
{
"updates": [
{
"campaign_id": "68b1c0d4e7b91d003c45a1f2",
"daily_budget_micros": 15000000
},
{
"campaign_id": "68b1c0d4e7b91d003c45a1f4",
"daily_budget_micros": 8000000
}
]
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/bulk-budget"
payload = { "updates": [
{
"campaign_id": "68b1c0d4e7b91d003c45a1f2",
"daily_budget_micros": 15000000
},
{
"campaign_id": "68b1c0d4e7b91d003c45a1f4",
"daily_budget_micros": 8000000
}
] }
headers = {
"api_key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {api_key: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
updates: [
{campaign_id: '68b1c0d4e7b91d003c45a1f2', daily_budget_micros: 15000000},
{campaign_id: '68b1c0d4e7b91d003c45a1f4', daily_budget_micros: 8000000}
]
})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/bulk-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/bulk-budget",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'updates' => [
[
'campaign_id' => '68b1c0d4e7b91d003c45a1f2',
'daily_budget_micros' => 15000000
],
[
'campaign_id' => '68b1c0d4e7b91d003c45a1f4',
'daily_budget_micros' => 8000000
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_key: <api-key>"
],
]);
$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/bulk-budget"
payload := strings.NewReader("{\n \"updates\": [\n {\n \"campaign_id\": \"68b1c0d4e7b91d003c45a1f2\",\n \"daily_budget_micros\": 15000000\n },\n {\n \"campaign_id\": \"68b1c0d4e7b91d003c45a1f4\",\n \"daily_budget_micros\": 8000000\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("api_key", "<api-key>")
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.patch("https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/bulk-budget")
.header("api_key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"updates\": [\n {\n \"campaign_id\": \"68b1c0d4e7b91d003c45a1f2\",\n \"daily_budget_micros\": 15000000\n },\n {\n \"campaign_id\": \"68b1c0d4e7b91d003c45a1f4\",\n \"daily_budget_micros\": 8000000\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/bulk-budget")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["api_key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"updates\": [\n {\n \"campaign_id\": \"68b1c0d4e7b91d003c45a1f2\",\n \"daily_budget_micros\": 15000000\n },\n {\n \"campaign_id\": \"68b1c0d4e7b91d003c45a1f4\",\n \"daily_budget_micros\": 8000000\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"succeeded": [
"68b1c0d4e7b91d003c45a1f2"
],
"failed": [
{
"campaign_id": "68b1c0d4e7b91d003c45a1f4",
"reason": "Budget below the minimum for this currency"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Personal API key.
Path Parameters
ID of the app whose Google Ads campaigns to manage.
Body
One entry per campaign. An empty array is accepted and changes nothing.
Show child attributes
Show child attributes
Response
Successful Response
Per-campaign outcome of a bulk budget update.
IDs of the campaigns whose budget was updated.
["68b1c0d4e7b91d003c45a1f2"]
Campaigns that were left unchanged, each with a reason. Empty when every update applied.
Show child attributes
Show child attributes
[
{
"campaign_id": "68b1c0d4e7b91d003c45a1f4",
"reason": "Budget below the minimum for this currency"
}
]
Was this page helpful?