curl --request POST \
--url http://localhost:8000/api/v1/campaigns/prefill \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8000/api/v1/campaigns/prefill"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8000/api/v1/campaigns/prefill', 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/prefill",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/api/v1/campaigns/prefill"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8000/api/v1/campaigns/prefill")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/campaigns/prefill")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"market_analysis_id": 123,
"market_analysis_title": "<string>",
"google_ads_customer_id": 123,
"suggested_campaign_name": "<string>",
"language_ids": [
123
],
"location_targets": [
{
"geo_target_constant_id": 123,
"target_type": "INCLUDE"
}
],
"network_settings": {
"target_google_search": true,
"target_search_network": false,
"target_content_network": false
},
"ad_schedule": {
"mode": "ALL_TIME",
"schedule_entries": [
{
"day_of_week": "MONDAY",
"start_hour": 11,
"end_hour": 12,
"start_minute": 0,
"end_minute": 0
}
]
},
"default_match_type": "EXACT",
"ad_groups": [
{
"id": 123,
"name": "<string>",
"keywords": [
{
"text": "<string>",
"match_type": "EXACT",
"cpc_bid_micros": 123,
"final_url": "<string>",
"market_analysis_keyword_id": 123
}
],
"cpc_bid_micros": 123
}
],
"draft_id": 123,
"website_url": "<string>",
"bidding_strategy": {
"type": "MAXIMIZE_CONVERSIONS",
"target_cpa_micros": 123,
"target_roas": 1,
"max_cpc_bid_ceiling_micros": 123
},
"conversion_goals": [
{
"goal_type": "CAMPAIGN_SPECIFIC",
"conversion_action_id": 1,
"category": "PURCHASE"
}
],
"extensions": {
"sitelinks": [
{
"link_text": "<string>",
"final_url": "<string>",
"description_1": "<string>",
"description_2": "<string>",
"final_mobile_url": "<string>"
}
],
"callouts": [
{
"callout_text": "<string>"
}
],
"phone": {
"phone_number": "<string>",
"country_code": "<string>"
},
"structured_snippets": [
{
"header": "AMENITIES",
"values": [
"<string>"
]
}
]
},
"ad_groups_task_id": "<string>",
"rsa_task_ids": [
"<string>"
],
"ad_groups_generation_status": "pending",
"ad_groups_generation_error": "<string>",
"rsas_generation_status": "not_started",
"extensions_generation_status": "not_started",
"is_published": false,
"all_rsas_generated": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create pre-populated campaign draft from market analysis
Get pre-populated campaign configuration based on a market analysis.
This endpoint:
- Creates a campaign draft internally
- Kicks off async tasks for AI-powered ad group splitting and RSA generation
- Returns immediately with draft_id and task_ids for polling
The response includes:
- Campaign name suggestion based on analysis title
- Location targets from analysis config
- Language targeting from analysis config
- Initial ad group with all selected keywords
- Suggested daily budget based on keyword bid estimates
- draft_id and task_ids for polling generation status
Poll /drafts/{draft_id}/generation-status to check task completion.
Once complete, fetch /drafts/{draft_id} for AI-generated ad groups and RSAs.
The following fields require user input and are returned empty:
- conversion_goals (defaults to ACCOUNT_DEFAULT, can be customized)
- extensions (optional, user-defined)
curl --request POST \
--url http://localhost:8000/api/v1/campaigns/prefill \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:8000/api/v1/campaigns/prefill"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:8000/api/v1/campaigns/prefill', 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/prefill",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:8000/api/v1/campaigns/prefill"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:8000/api/v1/campaigns/prefill")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/campaigns/prefill")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"market_analysis_id": 123,
"market_analysis_title": "<string>",
"google_ads_customer_id": 123,
"suggested_campaign_name": "<string>",
"language_ids": [
123
],
"location_targets": [
{
"geo_target_constant_id": 123,
"target_type": "INCLUDE"
}
],
"network_settings": {
"target_google_search": true,
"target_search_network": false,
"target_content_network": false
},
"ad_schedule": {
"mode": "ALL_TIME",
"schedule_entries": [
{
"day_of_week": "MONDAY",
"start_hour": 11,
"end_hour": 12,
"start_minute": 0,
"end_minute": 0
}
]
},
"default_match_type": "EXACT",
"ad_groups": [
{
"id": 123,
"name": "<string>",
"keywords": [
{
"text": "<string>",
"match_type": "EXACT",
"cpc_bid_micros": 123,
"final_url": "<string>",
"market_analysis_keyword_id": 123
}
],
"cpc_bid_micros": 123
}
],
"draft_id": 123,
"website_url": "<string>",
"bidding_strategy": {
"type": "MAXIMIZE_CONVERSIONS",
"target_cpa_micros": 123,
"target_roas": 1,
"max_cpc_bid_ceiling_micros": 123
},
"conversion_goals": [
{
"goal_type": "CAMPAIGN_SPECIFIC",
"conversion_action_id": 1,
"category": "PURCHASE"
}
],
"extensions": {
"sitelinks": [
{
"link_text": "<string>",
"final_url": "<string>",
"description_1": "<string>",
"description_2": "<string>",
"final_mobile_url": "<string>"
}
],
"callouts": [
{
"callout_text": "<string>"
}
],
"phone": {
"phone_number": "<string>",
"country_code": "<string>"
},
"structured_snippets": [
{
"header": "AMENITIES",
"values": [
"<string>"
]
}
]
},
"ad_groups_task_id": "<string>",
"rsa_task_ids": [
"<string>"
],
"ad_groups_generation_status": "pending",
"ad_groups_generation_error": "<string>",
"rsas_generation_status": "not_started",
"extensions_generation_status": "not_started",
"is_published": false,
"all_rsas_generated": false
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Query Parameters
Market analysis ID to prefill from
Response
Successful Response
Response schema for campaign prefill from market analysis.
Contains pre-populated campaign data derived from market analysis. A draft is created internally and async tasks are kicked off for ad group splitting and RSA generation.
Fields requiring user input are returned as empty/null.
Show child attributes
Show child attributes
Network settings for campaign.
Show child attributes
Show child attributes
Ad schedule configuration.
Show child attributes
Show child attributes
The keyword match types.
EXACT, PHRASE, BROAD, BROAD_MODIFIER, NEGATIVE Show child attributes
Show child attributes
1 - 2083Bidding strategy configuration.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
All extensions configuration.
Show child attributes
Show child attributes
Status of background task generation (ad groups, RSAs).
not_started, pending, in_progress, completed, failed Status of background task generation (ad groups, RSAs).
not_started, pending, in_progress, completed, failed Status of background task generation (ad groups, RSAs).
not_started, pending, in_progress, completed, failed