Update ad
curl --request PATCH \
--url https://{publisher_host}/v1/ads/{ad_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Majorstuenveien 14 — oppdatert",
"budget": 5000,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"publisher_platforms": [
"<string>"
]
}
'import requests
url = "https://{publisher_host}/v1/ads/{ad_id}"
payload = {
"name": "Majorstuenveien 14 — oppdatert",
"budget": 5000,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"publisher_platforms": ["<string>"]
}
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({
name: 'Majorstuenveien 14 — oppdatert',
budget: 5000,
start_date: '2023-11-07T05:31:56Z',
end_date: '2023-11-07T05:31:56Z',
publisher_platforms: ['<string>']
})
};
fetch('https://{publisher_host}/v1/ads/{ad_id}', 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://{publisher_host}/v1/ads/{ad_id}",
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([
'name' => 'Majorstuenveien 14 — oppdatert',
'budget' => 5000,
'start_date' => '2023-11-07T05:31:56Z',
'end_date' => '2023-11-07T05:31:56Z',
'publisher_platforms' => [
'<string>'
]
]),
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://{publisher_host}/v1/ads/{ad_id}"
payload := strings.NewReader("{\n \"name\": \"Majorstuenveien 14 — oppdatert\",\n \"budget\": 5000,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"publisher_platforms\": [\n \"<string>\"\n ]\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://{publisher_host}/v1/ads/{ad_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Majorstuenveien 14 — oppdatert\",\n \"budget\": 5000,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"publisher_platforms\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{publisher_host}/v1/ads/{ad_id}")
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 \"name\": \"Majorstuenveien 14 — oppdatert\",\n \"budget\": 5000,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"publisher_platforms\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"ad_id": "ad_9pL2wR",
"campaign_id": "AbC123xyz",
"office_id": "off_8k2mQx",
"name": "Majorstuenveien 14",
"status": "active",
"budget": 5000,
"target_location": {
"country": "NO",
"lat": 59.9294,
"long": 10.7166,
"regions": [
"Oslo"
],
"radius_km": 10
},
"start_date": "2026-08-20T00:00:00Z",
"end_date": "2026-09-03T23:59:59Z",
"goal_config": {
"objective": "traffic",
"optimization_event": "link_click"
},
"publisher_platforms": [
"drammens_tidende",
"nettavisen",
"romerikes_blad"
],
"material": {
"target_url": "https://megler.no/eiendom/123",
"images": [
"https://example.com/property-photo.jpg"
],
"videos": [
"https://example.com/property-tour.mp4"
],
"html5": [
"https://example.com/creatives/majorstuenveien-14.html"
]
},
"created_at": "2026-08-19T08:12:00Z",
"updated_at": "2026-08-19T08:12:00Z"
}Ads
Update ad
Change mutable fields on an existing ad
PATCH
/
ads
/
{ad_id}
Update ad
curl --request PATCH \
--url https://{publisher_host}/v1/ads/{ad_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Majorstuenveien 14 — oppdatert",
"budget": 5000,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"publisher_platforms": [
"<string>"
]
}
'import requests
url = "https://{publisher_host}/v1/ads/{ad_id}"
payload = {
"name": "Majorstuenveien 14 — oppdatert",
"budget": 5000,
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"publisher_platforms": ["<string>"]
}
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({
name: 'Majorstuenveien 14 — oppdatert',
budget: 5000,
start_date: '2023-11-07T05:31:56Z',
end_date: '2023-11-07T05:31:56Z',
publisher_platforms: ['<string>']
})
};
fetch('https://{publisher_host}/v1/ads/{ad_id}', 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://{publisher_host}/v1/ads/{ad_id}",
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([
'name' => 'Majorstuenveien 14 — oppdatert',
'budget' => 5000,
'start_date' => '2023-11-07T05:31:56Z',
'end_date' => '2023-11-07T05:31:56Z',
'publisher_platforms' => [
'<string>'
]
]),
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://{publisher_host}/v1/ads/{ad_id}"
payload := strings.NewReader("{\n \"name\": \"Majorstuenveien 14 — oppdatert\",\n \"budget\": 5000,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"publisher_platforms\": [\n \"<string>\"\n ]\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://{publisher_host}/v1/ads/{ad_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Majorstuenveien 14 — oppdatert\",\n \"budget\": 5000,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"publisher_platforms\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{publisher_host}/v1/ads/{ad_id}")
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 \"name\": \"Majorstuenveien 14 — oppdatert\",\n \"budget\": 5000,\n \"start_date\": \"2023-11-07T05:31:56Z\",\n \"end_date\": \"2023-11-07T05:31:56Z\",\n \"publisher_platforms\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"ad_id": "ad_9pL2wR",
"campaign_id": "AbC123xyz",
"office_id": "off_8k2mQx",
"name": "Majorstuenveien 14",
"status": "active",
"budget": 5000,
"target_location": {
"country": "NO",
"lat": 59.9294,
"long": 10.7166,
"regions": [
"Oslo"
],
"radius_km": 10
},
"start_date": "2026-08-20T00:00:00Z",
"end_date": "2026-09-03T23:59:59Z",
"goal_config": {
"objective": "traffic",
"optimization_event": "link_click"
},
"publisher_platforms": [
"drammens_tidende",
"nettavisen",
"romerikes_blad"
],
"material": {
"target_url": "https://megler.no/eiendom/123",
"images": [
"https://example.com/property-photo.jpg"
],
"videos": [
"https://example.com/property-tour.mp4"
],
"html5": [
"https://example.com/creatives/majorstuenveien-14.html"
]
},
"created_at": "2026-08-19T08:12:00Z",
"updated_at": "2026-08-19T08:12:00Z"
}Overview
Update an existing ad. Omitted fields stay unchanged.campaign_id and office_id cannot be changed after creation.
Targeter uses this for budget changes, flight date shifts, creative swaps, targeting edits, and platform mix updates.
Return 409 if the ad is completed, rejected, or otherwise not editable.
Request
Headers
Authorization: Bearer {token}(required)Content-Type: application/json
Path Parameters
Publisher-generated ad id returned from Create ad
Body Parameters
All fields are optional. Send only the fields that should change. Shapes match Create ad.Replacement landing page and creatives. Include
target_url plus at least one of images, videos, or html5.Example Request
curl -X PATCH "https://publisher.example.com/v1/ads/ad_9pL2wR" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"budget": 7500,
"end_date": "2026-09-10T23:59:59Z"
}'
Response
Success (200)
Returns the full ad after the update, includingad_id and current status.
{
"ad_id": "ad_9pL2wR",
"campaign_id": "AbC123xyz",
"office_id": "off_8k2mQx",
"name": "Majorstuenveien 14",
"status": "active",
"budget": 7500,
"end_date": "2026-09-10T23:59:59Z"
}
Error Responses
400 - Invalid request payload
{
"error": "Invalid request payload",
"details": [
{
"path": ["end_date"],
"message": "end_date must be on or after start_date"
}
]
}
401 - Unauthorized
{
"error": "Missing or invalid Authorization header"
}
404 - Ad not found
{
"error": "Ad not found"
}
409 - Ad cannot be updated
{
"error": "Ad cannot be updated while status is completed"
}
500 - Server Error
{
"error": "Unexpected server error. Please try again later."
}
Authorizations
Body
application/json
Any subset of mutable ad fields. Omitted fields are unchanged.
Response
Ad updated