Patch Live Campaign Settings
curl --request PATCH \
--url http://localhost:8000/api/v1/campaigns/live/{customer_id}/{campaign_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"campaign_name": "<string>",
"daily_budget_micros": 123,
"bidding_strategy": {
"target_cpa_micros": 123,
"target_roas": 1,
"max_cpc_bid_ceiling_micros": 123
},
"network_settings": {
"target_google_search": true,
"target_search_network": false,
"target_content_network": false
},
"language_ids": [
123
],
"location_targets": [
{
"geo_target_constant_id": 123,
"target_type": "INCLUDE"
}
],
"ad_schedule": {
"schedule_entries": [
{
"start_hour": 11,
"end_hour": 12,
"start_minute": 0,
"end_minute": 0
}
]
},
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"conversion_goals": [
{
"conversion_action_id": 1
}
]
}
'import requests
url = "http://localhost:8000/api/v1/campaigns/live/{customer_id}/{campaign_id}"
payload = {
"campaign_name": "<string>",
"daily_budget_micros": 123,
"bidding_strategy": {
"target_cpa_micros": 123,
"target_roas": 1,
"max_cpc_bid_ceiling_micros": 123
},
"network_settings": {
"target_google_search": True,
"target_search_network": False,
"target_content_network": False
},
"language_ids": [123],
"location_targets": [
{
"geo_target_constant_id": 123,
"target_type": "INCLUDE"
}
],
"ad_schedule": { "schedule_entries": [
{
"start_hour": 11,
"end_hour": 12,
"start_minute": 0,
"end_minute": 0
}
] },
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"conversion_goals": [{ "conversion_action_id": 1 }]
}
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({
campaign_name: '<string>',
daily_budget_micros: 123,
bidding_strategy: {target_cpa_micros: 123, target_roas: 1, max_cpc_bid_ceiling_micros: 123},
network_settings: {
target_google_search: true,
target_search_network: false,
target_content_network: false
},
language_ids: [123],
location_targets: [{geo_target_constant_id: 123, target_type: 'INCLUDE'}],
ad_schedule: {
schedule_entries: [{start_hour: 11, end_hour: 12, start_minute: 0, end_minute: 0}]
},
start_date: '2023-12-25',
end_date: '2023-12-25',
conversion_goals: [{conversion_action_id: 1}]
})
};
fetch('http://localhost:8000/api/v1/campaigns/live/{customer_id}/{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_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/v1/campaigns/live/{customer_id}/{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([
'campaign_name' => '<string>',
'daily_budget_micros' => 123,
'bidding_strategy' => [
'target_cpa_micros' => 123,
'target_roas' => 1,
'max_cpc_bid_ceiling_micros' => 123
],
'network_settings' => [
'target_google_search' => true,
'target_search_network' => false,
'target_content_network' => false
],
'language_ids' => [
123
],
'location_targets' => [
[
'geo_target_constant_id' => 123,
'target_type' => 'INCLUDE'
]
],
'ad_schedule' => [
'schedule_entries' => [
[
'start_hour' => 11,
'end_hour' => 12,
'start_minute' => 0,
'end_minute' => 0
]
]
],
'start_date' => '2023-12-25',
'end_date' => '2023-12-25',
'conversion_goals' => [
[
'conversion_action_id' => 1
]
]
]),
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 := "http://localhost:8000/api/v1/campaigns/live/{customer_id}/{campaign_id}"
payload := strings.NewReader("{\n \"campaign_name\": \"<string>\",\n \"daily_budget_micros\": 123,\n \"bidding_strategy\": {\n \"target_cpa_micros\": 123,\n \"target_roas\": 1,\n \"max_cpc_bid_ceiling_micros\": 123\n },\n \"network_settings\": {\n \"target_google_search\": true,\n \"target_search_network\": false,\n \"target_content_network\": false\n },\n \"language_ids\": [\n 123\n ],\n \"location_targets\": [\n {\n \"geo_target_constant_id\": 123,\n \"target_type\": \"INCLUDE\"\n }\n ],\n \"ad_schedule\": {\n \"schedule_entries\": [\n {\n \"start_hour\": 11,\n \"end_hour\": 12,\n \"start_minute\": 0,\n \"end_minute\": 0\n }\n ]\n },\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"conversion_goals\": [\n {\n \"conversion_action_id\": 1\n }\n ]\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("http://localhost:8000/api/v1/campaigns/live/{customer_id}/{campaign_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"campaign_name\": \"<string>\",\n \"daily_budget_micros\": 123,\n \"bidding_strategy\": {\n \"target_cpa_micros\": 123,\n \"target_roas\": 1,\n \"max_cpc_bid_ceiling_micros\": 123\n },\n \"network_settings\": {\n \"target_google_search\": true,\n \"target_search_network\": false,\n \"target_content_network\": false\n },\n \"language_ids\": [\n 123\n ],\n \"location_targets\": [\n {\n \"geo_target_constant_id\": 123,\n \"target_type\": \"INCLUDE\"\n }\n ],\n \"ad_schedule\": {\n \"schedule_entries\": [\n {\n \"start_hour\": 11,\n \"end_hour\": 12,\n \"start_minute\": 0,\n \"end_minute\": 0\n }\n ]\n },\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"conversion_goals\": [\n {\n \"conversion_action_id\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/campaigns/live/{customer_id}/{campaign_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"campaign_name\": \"<string>\",\n \"daily_budget_micros\": 123,\n \"bidding_strategy\": {\n \"target_cpa_micros\": 123,\n \"target_roas\": 1,\n \"max_cpc_bid_ceiling_micros\": 123\n },\n \"network_settings\": {\n \"target_google_search\": true,\n \"target_search_network\": false,\n \"target_content_network\": false\n },\n \"language_ids\": [\n 123\n ],\n \"location_targets\": [\n {\n \"geo_target_constant_id\": 123,\n \"target_type\": \"INCLUDE\"\n }\n ],\n \"ad_schedule\": {\n \"schedule_entries\": [\n {\n \"start_hour\": 11,\n \"end_hour\": 12,\n \"start_minute\": 0,\n \"end_minute\": 0\n }\n ]\n },\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"conversion_goals\": [\n {\n \"conversion_action_id\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"campaign_updated": false,
"budget_updated": false,
"targeting_updated": false,
"conversion_goals_updated": false,
"warnings": [
"<string>"
],
"errors": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Campaigns
Patch Live Campaign Settings
Update settings on a live Google Ads campaign.
Only provided fields are updated. Targeting fields (locations, languages, ad schedule) use replace-all semantics.
PATCH
/
api
/
v1
/
campaigns
/
live
/
{customer_id}
/
{campaign_id}
Patch Live Campaign Settings
curl --request PATCH \
--url http://localhost:8000/api/v1/campaigns/live/{customer_id}/{campaign_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"campaign_name": "<string>",
"daily_budget_micros": 123,
"bidding_strategy": {
"target_cpa_micros": 123,
"target_roas": 1,
"max_cpc_bid_ceiling_micros": 123
},
"network_settings": {
"target_google_search": true,
"target_search_network": false,
"target_content_network": false
},
"language_ids": [
123
],
"location_targets": [
{
"geo_target_constant_id": 123,
"target_type": "INCLUDE"
}
],
"ad_schedule": {
"schedule_entries": [
{
"start_hour": 11,
"end_hour": 12,
"start_minute": 0,
"end_minute": 0
}
]
},
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"conversion_goals": [
{
"conversion_action_id": 1
}
]
}
'import requests
url = "http://localhost:8000/api/v1/campaigns/live/{customer_id}/{campaign_id}"
payload = {
"campaign_name": "<string>",
"daily_budget_micros": 123,
"bidding_strategy": {
"target_cpa_micros": 123,
"target_roas": 1,
"max_cpc_bid_ceiling_micros": 123
},
"network_settings": {
"target_google_search": True,
"target_search_network": False,
"target_content_network": False
},
"language_ids": [123],
"location_targets": [
{
"geo_target_constant_id": 123,
"target_type": "INCLUDE"
}
],
"ad_schedule": { "schedule_entries": [
{
"start_hour": 11,
"end_hour": 12,
"start_minute": 0,
"end_minute": 0
}
] },
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"conversion_goals": [{ "conversion_action_id": 1 }]
}
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({
campaign_name: '<string>',
daily_budget_micros: 123,
bidding_strategy: {target_cpa_micros: 123, target_roas: 1, max_cpc_bid_ceiling_micros: 123},
network_settings: {
target_google_search: true,
target_search_network: false,
target_content_network: false
},
language_ids: [123],
location_targets: [{geo_target_constant_id: 123, target_type: 'INCLUDE'}],
ad_schedule: {
schedule_entries: [{start_hour: 11, end_hour: 12, start_minute: 0, end_minute: 0}]
},
start_date: '2023-12-25',
end_date: '2023-12-25',
conversion_goals: [{conversion_action_id: 1}]
})
};
fetch('http://localhost:8000/api/v1/campaigns/live/{customer_id}/{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_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/v1/campaigns/live/{customer_id}/{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([
'campaign_name' => '<string>',
'daily_budget_micros' => 123,
'bidding_strategy' => [
'target_cpa_micros' => 123,
'target_roas' => 1,
'max_cpc_bid_ceiling_micros' => 123
],
'network_settings' => [
'target_google_search' => true,
'target_search_network' => false,
'target_content_network' => false
],
'language_ids' => [
123
],
'location_targets' => [
[
'geo_target_constant_id' => 123,
'target_type' => 'INCLUDE'
]
],
'ad_schedule' => [
'schedule_entries' => [
[
'start_hour' => 11,
'end_hour' => 12,
'start_minute' => 0,
'end_minute' => 0
]
]
],
'start_date' => '2023-12-25',
'end_date' => '2023-12-25',
'conversion_goals' => [
[
'conversion_action_id' => 1
]
]
]),
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 := "http://localhost:8000/api/v1/campaigns/live/{customer_id}/{campaign_id}"
payload := strings.NewReader("{\n \"campaign_name\": \"<string>\",\n \"daily_budget_micros\": 123,\n \"bidding_strategy\": {\n \"target_cpa_micros\": 123,\n \"target_roas\": 1,\n \"max_cpc_bid_ceiling_micros\": 123\n },\n \"network_settings\": {\n \"target_google_search\": true,\n \"target_search_network\": false,\n \"target_content_network\": false\n },\n \"language_ids\": [\n 123\n ],\n \"location_targets\": [\n {\n \"geo_target_constant_id\": 123,\n \"target_type\": \"INCLUDE\"\n }\n ],\n \"ad_schedule\": {\n \"schedule_entries\": [\n {\n \"start_hour\": 11,\n \"end_hour\": 12,\n \"start_minute\": 0,\n \"end_minute\": 0\n }\n ]\n },\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"conversion_goals\": [\n {\n \"conversion_action_id\": 1\n }\n ]\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("http://localhost:8000/api/v1/campaigns/live/{customer_id}/{campaign_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"campaign_name\": \"<string>\",\n \"daily_budget_micros\": 123,\n \"bidding_strategy\": {\n \"target_cpa_micros\": 123,\n \"target_roas\": 1,\n \"max_cpc_bid_ceiling_micros\": 123\n },\n \"network_settings\": {\n \"target_google_search\": true,\n \"target_search_network\": false,\n \"target_content_network\": false\n },\n \"language_ids\": [\n 123\n ],\n \"location_targets\": [\n {\n \"geo_target_constant_id\": 123,\n \"target_type\": \"INCLUDE\"\n }\n ],\n \"ad_schedule\": {\n \"schedule_entries\": [\n {\n \"start_hour\": 11,\n \"end_hour\": 12,\n \"start_minute\": 0,\n \"end_minute\": 0\n }\n ]\n },\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"conversion_goals\": [\n {\n \"conversion_action_id\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/campaigns/live/{customer_id}/{campaign_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"campaign_name\": \"<string>\",\n \"daily_budget_micros\": 123,\n \"bidding_strategy\": {\n \"target_cpa_micros\": 123,\n \"target_roas\": 1,\n \"max_cpc_bid_ceiling_micros\": 123\n },\n \"network_settings\": {\n \"target_google_search\": true,\n \"target_search_network\": false,\n \"target_content_network\": false\n },\n \"language_ids\": [\n 123\n ],\n \"location_targets\": [\n {\n \"geo_target_constant_id\": 123,\n \"target_type\": \"INCLUDE\"\n }\n ],\n \"ad_schedule\": {\n \"schedule_entries\": [\n {\n \"start_hour\": 11,\n \"end_hour\": 12,\n \"start_minute\": 0,\n \"end_minute\": 0\n }\n ]\n },\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"conversion_goals\": [\n {\n \"conversion_action_id\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"campaign_updated": false,
"budget_updated": false,
"targeting_updated": false,
"conversion_goals_updated": false,
"warnings": [
"<string>"
],
"errors": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Query Parameters
Optional specific Token ID
Body
application/json
Request schema for updating live campaign settings. All fields optional.
Required string length:
1 - 256Available options:
ENABLED, PAUSED Bidding strategy configuration.
Show child attributes
Show child attributes
Network settings for campaign.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Ad schedule configuration.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I