curl --request PUT \
--url https://api.aisa.one/apis/v1/ads/campaigns/{campaignId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
]),
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}"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PUT", 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.put("https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"bidAmount": 123,
"bidStrategy": "LOWEST_COST_WITHOUT_CAP",
"budget": {
"amount": 123,
"type": "daily",
"amountMicros": "<string>",
"deliveryMethod": "<string>",
"explicitlyShared": true,
"resourceName": "<string>"
},
"budgetLevel": "campaign",
"finalUrlSuffix": "<string>",
"manualCpc": {
"maxCpc": 123
},
"networkSettings": {
"displayNetwork": true,
"searchPartners": true
},
"platformSpecificData": {},
"portfolioBidStrategyId": "<string>",
"roasAverageFloor": 123,
"sharedBudgetId": "<string>",
"targetImpressionShare": {
"location": "ANYWHERE_ON_PAGE",
"maxCpc": 123,
"percent": 99
},
"trackingUrlTemplate": "<string>",
"updated": 123
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}Update a campaign
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. Changes a campaign’s budget or bidding. Changes a campaign’s settings, such as its name, budget, bidding or tracking URLs. Send at least one of budget, bidStrategy, portfolioBidStrategyId, targetImpressionShare, manualCpc, networkSettings, trackingUrlTemplate, finalUrlSuffix, sharedBudgetId, name or platformSpecificData. An unsupported field is always an error, never a silent drop.
curl --request PUT \
--url https://api.aisa.one/apis/v1/ads/campaigns/{campaignId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
]),
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}"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("PUT", 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.put("https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/ads/campaigns/{campaignId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"bidAmount": 123,
"bidStrategy": "LOWEST_COST_WITHOUT_CAP",
"budget": {
"amount": 123,
"type": "daily",
"amountMicros": "<string>",
"deliveryMethod": "<string>",
"explicitlyShared": true,
"resourceName": "<string>"
},
"budgetLevel": "campaign",
"finalUrlSuffix": "<string>",
"manualCpc": {
"maxCpc": 123
},
"networkSettings": {
"displayNetwork": true,
"searchPartners": true
},
"platformSpecificData": {},
"portfolioBidStrategyId": "<string>",
"roasAverageFloor": 123,
"sharedBudgetId": "<string>",
"targetImpressionShare": {
"location": "ANYWHERE_ON_PAGE",
"maxCpc": 123,
"percent": 99
},
"trackingUrlTemplate": "<string>",
"updated": 123
}{
"error": {
"code": "<string>",
"details": {},
"message": "<string>",
"param": "<string>",
"retryHint": "<string>",
"retryable": true,
"type": "<string>"
}
}Request contract
- Method and path: PUT /apis/v1/ads/campaigns/{campaignId}
- Availability: enabled
- Request URL template:
https://api.aisa.one/apis/v1/ads/campaigns/{campaignId} - campaignId: path; required
- connectionId: query; required
- X-Aisa-Confirm: header; optional
{
"operationId": "put_aisa_ads_apis_v1_ads_campaigns_campaignid",
"method": "PUT",
"path": "/apis/v1/ads/campaigns/{campaignId}",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [
{
"description": "Platform campaign ID",
"in": "path",
"name": "campaignId",
"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": {
"budget": {
"amount": 8,
"type": "daily"
},
"connectionId": "adc_7f3k2m9q",
"platform": "facebook"
},
"schema": {
"additionalProperties": true,
"properties": {
"allowSharedBudgetUpdate": {
"default": false,
"description": "Google only. Explicitly allow changing a shared campaign budget (flagged as shared by Google, or used by more than one campaign), affecting every campaign that uses it. Does not bypass an unknown sharing state.",
"type": "boolean"
},
"bidAmount": {
"description": "Google only. Whole currency units (USD: 12 = $12.00). Max CPC for LOWEST_COST_WITH_BID_CAP, CPA target for COST_CAP; required for both.",
"type": "number"
},
"bidStrategy": {
"description": "Meta + Google. Meta: the campaign default that ad sets inherit unless they override it. Google: the campaign's own bidding strategy.",
"enum": [
"LOWEST_COST_WITHOUT_CAP",
"LOWEST_COST_WITH_BID_CAP",
"COST_CAP",
"LOWEST_COST_WITH_MIN_ROAS"
],
"type": "string"
},
"budget": {
"description": "Meta CBO, Google daily, or OpenAI Ads or Reddit Ads daily or lifetime campaign budget, in whole currency units.",
"properties": {
"amount": {
"description": "Budget amount in the ad account's currency",
"type": "number"
},
"type": {
"enum": [
"daily",
"lifetime"
],
"type": "string"
}
},
"required": [
"amount",
"type"
],
"type": "object"
},
"connectionId": {
"description": "The ads connection (adc_...), when not sent as the connectionId query parameter.",
"pattern": "^adc_[0-9A-Za-z]+$",
"type": "string"
},
"finalUrlSuffix": {
"description": "Google only. campaign.final_url_suffix; an empty string clears it.",
"type": "string"
},
"manualCpc": {
"additionalProperties": false,
"description": "Google Search and Display only. Manual CPC bidding. Enhanced CPC is not offered: Google no longer lets Search and Display campaigns enable it. Exclusive with every other strategy field.",
"properties": {
"maxCpc": {
"description": "Max CPC of the ad groups, in the account's currency units: set on the ad group created with the campaign, and on every ad group of the campaign when an update switches it to Manual CPC. Google gives an ad group without one a 0.01 bid.",
"exclusiveMinimum": 0,
"type": "number"
}
},
"required": [
"maxCpc"
],
"type": "object"
},
"name": {
"description": "Meta and Reddit. Rename the campaign.",
"maxLength": 255,
"type": "string"
},
"networkSettings": {
"additionalProperties": false,
"description": "Google Search campaigns only. Which networks the campaign serves on besides Google Search.",
"properties": {
"displayNetwork": {
"description": "campaign.network_settings.target_content_network (Search with Display expansion)",
"type": "boolean"
},
"searchPartners": {
"description": "campaign.network_settings.target_search_network",
"type": "boolean"
}
},
"type": "object"
},
"platform": {
"description": "Required: platform campaign IDs are not globally unique. Filled from the connection when omitted.",
"enum": [
"facebook",
"instagram",
"tiktok",
"linkedin",
"pinterest",
"google",
"twitter",
"openai",
"reddit",
"microsoft",
"meta",
"x"
],
"type": "string"
},
"platformSpecificData": {
"description": "Meta only. Platform implied by the `platform` body param, same convention as POST /apis/v1/ads/create.",
"properties": {
"spendCap": {
"description": "Campaign lifetime spend cap, in the ad account's currency (Meta `spend_cap`). Pass null to remove the cap; 0 is rejected by Meta.",
"type": [
"number",
"null"
]
}
},
"type": "object"
},
"portfolioBidStrategyId": {
"description": "Google only. Attach an existing portfolio bid strategy (numeric id from GET /apis/v1/ads/bid-strategies) instead of setting bidStrategy. Exclusive with bidStrategy.",
"pattern": "^\\d+$",
"type": "string"
},
"roasAverageFloor": {
"description": "Google only. Decimal ROAS multiplier (2.0 = 2.0x), required for LOWEST_COST_WITH_MIN_ROAS.",
"type": "number"
},
"sharedBudgetId": {
"description": "Google only. Move the campaign onto this shared budget (id from GET /apis/v1/ads/shared-budgets), or null to move it back onto a budget of its own sized by `budget`.",
"pattern": "^\\d+$",
"type": [
"string",
"null"
]
},
"targetImpressionShare": {
"additionalProperties": false,
"description": "Google Search only. Target impression share bidding. Exclusive with bidStrategy, portfolioBidStrategyId and manualCpc; bidAmount is refused alongside it (the ceiling is maxCpc).",
"properties": {
"location": {
"enum": [
"ANYWHERE_ON_PAGE",
"TOP_OF_PAGE",
"ABSOLUTE_TOP_OF_PAGE"
],
"type": "string"
},
"maxCpc": {
"description": "Max CPC bid limit, in the account's currency units. Google requires it.",
"exclusiveMinimum": 0,
"type": "number"
},
"percent": {
"description": "Target share of impressions, in percent (65 = 65%). Sent to Google as location_fraction_micros (1% = 10,000).",
"exclusiveMinimum": 0,
"maximum": 100,
"type": "number"
}
},
"required": [
"location",
"maxCpc",
"percent"
],
"type": "object"
},
"trackingUrlTemplate": {
"description": "Google only. campaign.tracking_url_template; an empty string clears it.",
"type": "string"
}
},
"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
Response
Campaign updated
Echoes back only the fields you sent, plus updated.
Meta bid strategy. Same enum applies at campaign and ad-set level; ad-set value (when set) overrides campaign-level. Cross-field rules: LOWEST_COST_WITHOUT_CAP (default): auto-bid, forbids bidAmount and roasAverageFloor.
LOWEST_COST_WITHOUT_CAP, LOWEST_COST_WITH_BID_CAP, COST_CAP, LOWEST_COST_WITH_MIN_ROAS