Create Responsive Search Ad in ad group
curl --request POST \
--url https://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/ad-groups/{adGroupId}/ads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"headlines": [
"<string>"
],
"descriptions": [
"<string>"
],
"finalUrl": "<string>",
"path1": "<string>",
"path2": "<string>",
"adResourceNameToRemove": "<string>",
"ignorablePolicyTopics": [
"<string>"
],
"loginCustomerId": "<string>",
"validateOnly": true
}
'import requests
url = "https://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/ad-groups/{adGroupId}/ads"
payload = {
"headlines": ["<string>"],
"descriptions": ["<string>"],
"finalUrl": "<string>",
"path1": "<string>",
"path2": "<string>",
"adResourceNameToRemove": "<string>",
"ignorablePolicyTopics": ["<string>"],
"loginCustomerId": "<string>",
"validateOnly": True
}
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({
headlines: ['<string>'],
descriptions: ['<string>'],
finalUrl: '<string>',
path1: '<string>',
path2: '<string>',
adResourceNameToRemove: '<string>',
ignorablePolicyTopics: ['<string>'],
loginCustomerId: '<string>',
validateOnly: true
})
};
fetch('https://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/ad-groups/{adGroupId}/ads', 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.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/ad-groups/{adGroupId}/ads",
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([
'headlines' => [
'<string>'
],
'descriptions' => [
'<string>'
],
'finalUrl' => '<string>',
'path1' => '<string>',
'path2' => '<string>',
'adResourceNameToRemove' => '<string>',
'ignorablePolicyTopics' => [
'<string>'
],
'loginCustomerId' => '<string>',
'validateOnly' => true
]),
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.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/ad-groups/{adGroupId}/ads"
payload := strings.NewReader("{\n \"headlines\": [\n \"<string>\"\n ],\n \"descriptions\": [\n \"<string>\"\n ],\n \"finalUrl\": \"<string>\",\n \"path1\": \"<string>\",\n \"path2\": \"<string>\",\n \"adResourceNameToRemove\": \"<string>\",\n \"ignorablePolicyTopics\": [\n \"<string>\"\n ],\n \"loginCustomerId\": \"<string>\",\n \"validateOnly\": true\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.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/ad-groups/{adGroupId}/ads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"headlines\": [\n \"<string>\"\n ],\n \"descriptions\": [\n \"<string>\"\n ],\n \"finalUrl\": \"<string>\",\n \"path1\": \"<string>\",\n \"path2\": \"<string>\",\n \"adResourceNameToRemove\": \"<string>\",\n \"ignorablePolicyTopics\": [\n \"<string>\"\n ],\n \"loginCustomerId\": \"<string>\",\n \"validateOnly\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/ad-groups/{adGroupId}/ads")
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 \"headlines\": [\n \"<string>\"\n ],\n \"descriptions\": [\n \"<string>\"\n ],\n \"finalUrl\": \"<string>\",\n \"path1\": \"<string>\",\n \"path2\": \"<string>\",\n \"adResourceNameToRemove\": \"<string>\",\n \"ignorablePolicyTopics\": [\n \"<string>\"\n ],\n \"loginCustomerId\": \"<string>\",\n \"validateOnly\": true\n}"
response = http.request(request)
puts response.read_body{
"resourceName": "<string>",
"validateOnly": true
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Google Ads
Create Responsive Search Ad in ad group
Create a new Responsive Search Ad in an ad group. If adResourceNameToRemove is provided, the existing ad is removed in the same mutate call. Use validateOnly=true to test the payload without applying it.
POST
/
projects
/
{projectId}
/
google-ads
/
customers
/
{customerId}
/
ad-groups
/
{adGroupId}
/
ads
Create Responsive Search Ad in ad group
curl --request POST \
--url https://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/ad-groups/{adGroupId}/ads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"headlines": [
"<string>"
],
"descriptions": [
"<string>"
],
"finalUrl": "<string>",
"path1": "<string>",
"path2": "<string>",
"adResourceNameToRemove": "<string>",
"ignorablePolicyTopics": [
"<string>"
],
"loginCustomerId": "<string>",
"validateOnly": true
}
'import requests
url = "https://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/ad-groups/{adGroupId}/ads"
payload = {
"headlines": ["<string>"],
"descriptions": ["<string>"],
"finalUrl": "<string>",
"path1": "<string>",
"path2": "<string>",
"adResourceNameToRemove": "<string>",
"ignorablePolicyTopics": ["<string>"],
"loginCustomerId": "<string>",
"validateOnly": True
}
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({
headlines: ['<string>'],
descriptions: ['<string>'],
finalUrl: '<string>',
path1: '<string>',
path2: '<string>',
adResourceNameToRemove: '<string>',
ignorablePolicyTopics: ['<string>'],
loginCustomerId: '<string>',
validateOnly: true
})
};
fetch('https://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/ad-groups/{adGroupId}/ads', 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.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/ad-groups/{adGroupId}/ads",
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([
'headlines' => [
'<string>'
],
'descriptions' => [
'<string>'
],
'finalUrl' => '<string>',
'path1' => '<string>',
'path2' => '<string>',
'adResourceNameToRemove' => '<string>',
'ignorablePolicyTopics' => [
'<string>'
],
'loginCustomerId' => '<string>',
'validateOnly' => true
]),
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.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/ad-groups/{adGroupId}/ads"
payload := strings.NewReader("{\n \"headlines\": [\n \"<string>\"\n ],\n \"descriptions\": [\n \"<string>\"\n ],\n \"finalUrl\": \"<string>\",\n \"path1\": \"<string>\",\n \"path2\": \"<string>\",\n \"adResourceNameToRemove\": \"<string>\",\n \"ignorablePolicyTopics\": [\n \"<string>\"\n ],\n \"loginCustomerId\": \"<string>\",\n \"validateOnly\": true\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.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/ad-groups/{adGroupId}/ads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"headlines\": [\n \"<string>\"\n ],\n \"descriptions\": [\n \"<string>\"\n ],\n \"finalUrl\": \"<string>\",\n \"path1\": \"<string>\",\n \"path2\": \"<string>\",\n \"adResourceNameToRemove\": \"<string>\",\n \"ignorablePolicyTopics\": [\n \"<string>\"\n ],\n \"loginCustomerId\": \"<string>\",\n \"validateOnly\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sapt.ai/projects/{projectId}/google-ads/customers/{customerId}/ad-groups/{adGroupId}/ads")
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 \"headlines\": [\n \"<string>\"\n ],\n \"descriptions\": [\n \"<string>\"\n ],\n \"finalUrl\": \"<string>\",\n \"path1\": \"<string>\",\n \"path2\": \"<string>\",\n \"adResourceNameToRemove\": \"<string>\",\n \"ignorablePolicyTopics\": [\n \"<string>\"\n ],\n \"loginCustomerId\": \"<string>\",\n \"validateOnly\": true\n}"
response = http.request(request)
puts response.read_body{
"resourceName": "<string>",
"validateOnly": true
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Authorizations
JWT token obtained from /api/auth/token endpoint. Token is verified using JWKS and must include a valid user identifier.
Path Parameters
Minimum string length:
1Minimum string length:
1Body
application/json
Required array length:
3 - 15 elementsRequired array length:
2 - 4 elementsMaximum string length:
15Maximum string length:
15Minimum string length:
1Minimum string length:
1