curl --request PATCH \
--url https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"field": "name",
"value": "Spring sale in Berlin"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}"
payload = {
"field": "name",
"value": "Spring sale in Berlin"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({field: 'name', value: 'Spring sale in Berlin'})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}', 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}",
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([
'field' => 'name',
'value' => 'Spring sale in Berlin'
]),
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}"
payload := strings.NewReader("{\n \"field\": \"name\",\n \"value\": \"Spring sale in Berlin\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"field\": \"name\",\n \"value\": \"Spring sale in Berlin\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"field\": \"name\",\n \"value\": \"Spring sale in Berlin\"\n}"
response = http.request(request)
puts response.read_body{
"id": "68b1c0d4e7b91d003c45a1f2",
"campaign_name": "Spring sale in Berlin",
"daily_budget_micros": 15000000
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Update Google Ads campaign
Changes one section of a campaign and pushes it to Google.
Send the section in field and its new value in value. One section per request. To change a name and a budget, send two requests. Every list in value is the COMPLETE set the campaign should end up with, so an item you leave out is removed unless the field says otherwise, and a key you don’t send leaves that setting as it is. An unknown key or a value of the wrong type returns a 422.
Changing ad_copy sends the new text back through Google’s policy review, so the campaign can return to a reviewing state and stop serving until it clears. Changing budget takes effect for the rest of the current day.
Google validates the change, so text that breaks its policies or a budget below the currency’s floor comes back as a 400 with Google’s reason and the campaign is left as it was. To change the budget on several campaigns at once, use Update campaign budgets in bulk.
id plus only the section you changed, not the whole campaign. Read the campaign back with Get campaign when you need its full state.curl --request PATCH \
--url https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"field": "name",
"value": "Spring sale in Berlin"
}
'import requests
url = "https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}"
payload = {
"field": "name",
"value": "Spring sale in Berlin"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({field: 'name', value: 'Spring sale in Berlin'})
};
fetch('https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}', 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}",
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([
'field' => 'name',
'value' => 'Spring sale in Berlin'
]),
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}"
payload := strings.NewReader("{\n \"field\": \"name\",\n \"value\": \"Spring sale in Berlin\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"field\": \"name\",\n \"value\": \"Spring sale in Berlin\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/apps/{app_id}/google-ads/campaigns/{campaign_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"field\": \"name\",\n \"value\": \"Spring sale in Berlin\"\n}"
response = http.request(request)
puts response.read_body{
"id": "68b1c0d4e7b91d003c45a1f2",
"campaign_name": "Spring sale in Berlin",
"daily_budget_micros": 15000000
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}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
ID of the app whose Google Ads campaigns to manage.
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
- UpdateCampaignName
- UpdateCampaignBudget
- UpdateCampaignAdCopy
- UpdateCampaignDetails
- UpdateCampaignTargeting
- UpdateCampaignImages
- UpdateCampaignAsset
- UpdateCampaignAddVideo
- UpdateCampaignVideos
- UpdateCampaignProducts
Response
Successful Response
What an update returns, the campaign ID plus only the section that changed.
Base44's ID for the campaign. Absent when you changed images, which reports updated_field_types instead.
"68b1c0d4e7b91d003c45a1f2"
Present when you changed name.
"Spring sale in Berlin"
Present when you changed budget.
15000000
Was this page helpful?