Pause or enable a Search keyword
curl --request PATCH \
--url https://api.aisa.one/apis/v1/ads/keywords/{keywordId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "active"
}
'import requests
url = "https://api.aisa.one/apis/v1/ads/keywords/{keywordId}"
payload = { "status": "active" }
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({status: 'active'})
};
fetch('https://api.aisa.one/apis/v1/ads/keywords/{keywordId}', 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/keywords/{keywordId}",
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([
'status' => 'active'
]),
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/keywords/{keywordId}"
payload := strings.NewReader("{\n \"status\": \"active\"\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://api.aisa.one/apis/v1/ads/keywords/{keywordId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"active\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/ads/keywords/{keywordId}")
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 \"status\": \"active\"\n}"
response = http.request(request)
puts response.read_body{
"keyword": {
"adAccountId": "<string>",
"adSetId": "<string>",
"adSetName": "<string>",
"adSetStatus": "<string>",
"campaignId": "<string>",
"campaignName": "<string>",
"campaignStatus": "<string>",
"connectionId": "<string>",
"id": "<string>",
"keyword": "<string>",
"matchType": "exact",
"metrics": {
"clicks": 123,
"conversions": 123,
"cost": 123,
"firstPageCpc": 123,
"firstPositionCpc": 123,
"impressions": 123,
"windowDays": 123
},
"negative": true,
"platform": "google",
"platformCriterionId": "<string>",
"quality": {
"adRelevance": "BELOW_AVERAGE",
"expectedCtr": "BELOW_AVERAGE",
"landingPageExperience": "BELOW_AVERAGE",
"score": 123
},
"qualityScore": 123,
"resourceName": "<string>",
"status": "active",
"syncedAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}Keywords
Pause or enable a Search keyword
Ad Campaigns. A pause needs ads:write. A change to active turns delivery on: it needs ads:spend and X-Aisa-Confirm: spend. Pauses or re-enables a single Google Search keyword. Changes ad_group_criterion.status for one keyword criterion (M.140). Negative keywords have no status on Google and cannot be paused or enabled.
PATCH
https://api.aisa.one
/
apis
/
v1
/
ads
/
keywords
/
{keywordId}
Pause or enable a Search keyword
curl --request PATCH \
--url https://api.aisa.one/apis/v1/ads/keywords/{keywordId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "active"
}
'import requests
url = "https://api.aisa.one/apis/v1/ads/keywords/{keywordId}"
payload = { "status": "active" }
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({status: 'active'})
};
fetch('https://api.aisa.one/apis/v1/ads/keywords/{keywordId}', 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/keywords/{keywordId}",
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([
'status' => 'active'
]),
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/keywords/{keywordId}"
payload := strings.NewReader("{\n \"status\": \"active\"\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://api.aisa.one/apis/v1/ads/keywords/{keywordId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"active\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/ads/keywords/{keywordId}")
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 \"status\": \"active\"\n}"
response = http.request(request)
puts response.read_body{
"keyword": {
"adAccountId": "<string>",
"adSetId": "<string>",
"adSetName": "<string>",
"adSetStatus": "<string>",
"campaignId": "<string>",
"campaignName": "<string>",
"campaignStatus": "<string>",
"connectionId": "<string>",
"id": "<string>",
"keyword": "<string>",
"matchType": "exact",
"metrics": {
"clicks": 123,
"conversions": 123,
"cost": 123,
"firstPageCpc": 123,
"firstPositionCpc": 123,
"impressions": 123,
"windowDays": 123
},
"negative": true,
"platform": "google",
"platformCriterionId": "<string>",
"quality": {
"adRelevance": "BELOW_AVERAGE",
"expectedCtr": "BELOW_AVERAGE",
"landingPageExperience": "BELOW_AVERAGE",
"score": 123
},
"qualityScore": 123,
"resourceName": "<string>",
"status": "active",
"syncedAt": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}Request contract
- Method and path: PATCH /apis/v1/ads/keywords/{keywordId}
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/ads/keywords/{keywordId} - keywordId: path; required
- connectionId: query; required
- X-Aisa-Confirm: header; optional
{
"operationId": "patch_aisa_ads_apis_v1_ads_keywords_keywordid",
"method": "PATCH",
"path": "/apis/v1/ads/keywords/{keywordId}",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"description": "1234567890~987654321). A bare criterion id is rejected because it is only unique within its ad group.",
"in": "path",
"name": "keywordId",
"required": true,
"schema": {
"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": {
"connectionId": "adc_7f3k2m9q",
"status": "active"
},
"schema": {
"additionalProperties": true,
"properties": {
"connectionId": {
"description": "The ads connection (adc_...), when not sent as the connectionId query parameter.",
"pattern": "^adc_[0-9A-Za-z]+$",
"type": "string"
},
"status": {
"enum": [
"active",
"paused"
],
"type": "string"
}
},
"required": [
"status"
],
"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
Path Parameters
Query Parameters
Body
application/json