Create a Performance Max asset group
curl --request POST \
--url https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/asset-groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"finalUrls": [
"https://example.com/shoes"
],
"name": "Running shoes"
}
'import requests
url = "https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/asset-groups"
payload = {
"finalUrls": ["https://example.com/shoes"],
"name": "Running shoes"
}
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({finalUrls: ['https://example.com/shoes'], name: 'Running shoes'})
};
fetch('https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/asset-groups', 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://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/asset-groups",
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([
'finalUrls' => [
'https://example.com/shoes'
],
'name' => 'Running shoes'
]),
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://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/asset-groups"
payload := strings.NewReader("{\n \"finalUrls\": [\n \"https://example.com/shoes\"\n ],\n \"name\": \"Running shoes\"\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://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/asset-groups")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"finalUrls\": [\n \"https://example.com/shoes\"\n ],\n \"name\": \"Running shoes\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/asset-groups")
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 \"finalUrls\": [\n \"https://example.com/shoes\"\n ],\n \"name\": \"Running shoes\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"validateOnly": true
}{
"assetGroup": {
"campaignId": "<string>",
"id": "<string>",
"resourceName": "<string>"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}Performance Max
Create a Performance Max asset group
Ad Campaigns. Can spend money or change spend: needs the ads:spend scope and X-Aisa-Confirm: spend; without the header the request is refused with confirmation_required and nothing is sent. Creates a Performance Max asset group that can start serving. validateOnly=true checks the request without acting and needs no confirmation. Adds an asset group with its assets and optional product targeting to a Performance Max campaign, or just validates it without creating anything. The group, any new assets, their links and an optional listing-group tree are created in one atomic request, so Google checks the asset minimums (for non-retail campaigns) against the whole set. Created PAUSED unless status is ENABLED.
POST
https://api.aisa.one
/
apis
/
v1
/
ads
/
campaigns
/
{campaignId}
/
asset-groups
Create a Performance Max asset group
curl --request POST \
--url https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/asset-groups \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"finalUrls": [
"https://example.com/shoes"
],
"name": "Running shoes"
}
'import requests
url = "https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/asset-groups"
payload = {
"finalUrls": ["https://example.com/shoes"],
"name": "Running shoes"
}
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({finalUrls: ['https://example.com/shoes'], name: 'Running shoes'})
};
fetch('https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/asset-groups', 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://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/asset-groups",
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([
'finalUrls' => [
'https://example.com/shoes'
],
'name' => 'Running shoes'
]),
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://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/asset-groups"
payload := strings.NewReader("{\n \"finalUrls\": [\n \"https://example.com/shoes\"\n ],\n \"name\": \"Running shoes\"\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://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/asset-groups")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"finalUrls\": [\n \"https://example.com/shoes\"\n ],\n \"name\": \"Running shoes\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/asset-groups")
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 \"finalUrls\": [\n \"https://example.com/shoes\"\n ],\n \"name\": \"Running shoes\"\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"validateOnly": true
}{
"assetGroup": {
"campaignId": "<string>",
"id": "<string>",
"resourceName": "<string>"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}Request contract
- Method and path: POST /apis/v1/ads/campaigns/{campaignId}/asset-groups
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}/asset-groups - campaignId: path; required
- connectionId: query; required
- X-Aisa-Confirm: header; optional
{
"operationId": "post_aisa_ads_apis_v1_ads_campaigns_campaignid_as_bb4817",
"method": "POST",
"path": "/apis/v1/ads/campaigns/{campaignId}/asset-groups",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"description": "Google Ads campaign id.",
"in": "path",
"name": "campaignId",
"required": true,
"schema": {
"pattern": "^\\d+$",
"type": "string"
}
},
{
"description": "The ads connection (adc_...) the request runs on: one of yours, from GET /apis/v1/ads/connections. On a request with a JSON body it may be sent as a top-level body member instead.",
"in": "query",
"name": "connectionId",
"required": true,
"schema": {
"pattern": "^adc_[0-9A-Za-z]+$",
"type": "string"
}
},
{
"description": "Required with the value \"spend\" when the request can spend money or change spend. Without it the request is refused with 409 confirmation_required, which describes what would happen; nothing is sent to the ad platform.",
"in": "header",
"name": "X-Aisa-Confirm",
"required": false,
"schema": {
"enum": [
"spend"
],
"type": "string"
}
}
],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"example": {
"assets": [
{
"fieldType": "HEADLINE",
"text": "Shoes for every run"
},
{
"asset": "customers/9122445560/assets/352426364803",
"fieldType": "LOGO"
}
],
"connectionId": "adc_7f3k2m9q",
"finalUrls": [
"https://example.com/shoes"
],
"name": "Running shoes"
},
"schema": {
"additionalProperties": true,
"properties": {
"assets": {
"items": {
"description": "Link one asset to the asset group. Send exactly one of asset (an existing asset), text, imageUrl or youtubeVideoId (new content, created in the same request).",
"properties": {
"asset": {
"description": "Existing asset id or resource name customers/{customerId}/assets/{assetId}. Must belong to the campaign's ad account.",
"type": "string"
},
"fieldType": {
"description": "Google AssetFieldType, such as HEADLINE, LONG_HEADLINE, DESCRIPTION, BUSINESS_NAME, MARKETING_IMAGE, SQUARE_MARKETING_IMAGE, PORTRAIT_MARKETING_IMAGE, LOGO, LANDSCAPE_LOGO or YOUTUBE_VIDEO.",
"type": "string"
},
"imageUrl": {
"description": "Public http(s) image. Links as an image role or LOGO / LANDSCAPE_LOGO.",
"format": "uri",
"type": "string"
},
"text": {
"description": "Text assets link as HEADLINE, LONG_HEADLINE, DESCRIPTION or BUSINESS_NAME.",
"maxLength": 90,
"type": "string"
},
"youtubeVideoId": {
"description": "Links as YOUTUBE_VIDEO.",
"pattern": "^[A-Za-z0-9_-]{11}$",
"type": "string"
}
},
"required": [
"fieldType"
],
"type": "object"
},
"maxItems": 100,
"type": "array"
},
"connectionId": {
"description": "The ads connection (adc_...), when not sent as the connectionId query parameter.",
"pattern": "^adc_[0-9A-Za-z]+$",
"type": "string"
},
"finalMobileUrls": {
"items": {
"format": "uri",
"type": "string"
},
"maxItems": 10,
"minItems": 1,
"type": "array"
},
"finalUrls": {
"items": {
"format": "uri",
"type": "string"
},
"maxItems": 10,
"minItems": 1,
"type": "array"
},
"listingGroupFilter": {
"description": "The root of a Performance Max retail listing-group tree (listing source SHOPPING). No children targets all products. Requires a campaign linked to Merchant Center.",
"properties": {
"children": {
"items": {
"properties": {
"children": {
"description": "Makes the node a subdivision. Children share one dimension (and level or index) and include exactly one everything-else node.",
"items": {
"description": "Same shape as its parent.",
"type": "object"
},
"minItems": 2,
"type": "array"
},
"dimension": {
"description": "Exactly one key. Omit the value (for example { productBrand: {} }) for the everything-else node of that level.",
"properties": {
"productBrand": {
"properties": {
"value": {
"type": "string"
}
},
"type": "object"
},
"productCategory": {
"properties": {
"categoryId": {
"description": "Google product category id.",
"type": "string"
},
"level": {
"enum": [
"LEVEL1",
"LEVEL2",
"LEVEL3",
"LEVEL4",
"LEVEL5"
],
"type": "string"
}
},
"required": [
"level"
],
"type": "object"
},
"productChannel": {
"properties": {
"channel": {
"enum": [
"ONLINE",
"LOCAL"
],
"type": "string"
}
},
"type": "object"
},
"productCondition": {
"properties": {
"condition": {
"enum": [
"NEW",
"REFURBISHED",
"USED"
],
"type": "string"
}
},
"type": "object"
},
"productCustomAttribute": {
"properties": {
"index": {
"enum": [
"INDEX0",
"INDEX1",
"INDEX2",
"INDEX3",
"INDEX4"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"index"
],
"type": "object"
},
"productItemId": {
"properties": {
"value": {
"type": "string"
}
},
"type": "object"
},
"productType": {
"properties": {
"level": {
"enum": [
"LEVEL1",
"LEVEL2",
"LEVEL3",
"LEVEL4",
"LEVEL5"
],
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"level"
],
"type": "object"
}
},
"type": "object"
},
"excluded": {
"description": "Leaf only. true excludes these products.",
"type": "boolean"
}
},
"required": [
"dimension"
],
"type": "object"
},
"minItems": 2,
"type": "array"
}
},
"type": "object"
},
"name": {
"description": "Unique within the campaign.",
"maxLength": 128,
"minLength": 1,
"type": "string"
},
"path1": {
"maxLength": 15,
"type": "string"
},
"path2": {
"description": "Requires path1.",
"maxLength": 15,
"type": "string"
},
"status": {
"default": "PAUSED",
"enum": [
"ENABLED",
"PAUSED"
],
"type": "string"
},
"validateOnly": {
"default": false,
"type": "boolean"
}
},
"required": [
"finalUrls",
"name"
],
"type": "object"
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
Cost and request rules
No additional charge for this operation. Ad spend is billed separately by the ad platform to your connected ad account.Authorizations
Headers
Query Parameters
Body
application/json