curl --request PUT \
--url https://{domain}/api/v2/network/offers/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"title": "string",
"status": 1,
"advertiser_id": 1,
"currency": "USD",
"external_id": "string"
}
'import requests
url = "https://{domain}/api/v2/network/offers/{id}"
payload = {
"title": "string",
"status": 1,
"advertiser_id": 1,
"currency": "USD",
"external_id": "string"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'string',
status: 1,
advertiser_id: 1,
currency: 'USD',
external_id: 'string'
})
};
fetch('https://{domain}/api/v2/network/offers/{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://{domain}/api/v2/network/offers/{id}",
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([
'title' => 'string',
'status' => 1,
'advertiser_id' => 1,
'currency' => 'USD',
'external_id' => 'string'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://{domain}/api/v2/network/offers/{id}"
payload := strings.NewReader("{\n \"title\": \"string\",\n \"status\": 1,\n \"advertiser_id\": 1,\n \"currency\": \"USD\",\n \"external_id\": \"string\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://{domain}/api/v2/network/offers/{id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"string\",\n \"status\": 1,\n \"advertiser_id\": 1,\n \"currency\": \"USD\",\n \"external_id\": \"string\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/api/v2/network/offers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"string\",\n \"status\": 1,\n \"advertiser_id\": 1,\n \"currency\": \"USD\",\n \"external_id\": \"string\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"code": 200,
"name": "OK",
"message": "<string>",
"info": {
"offer": {}
}
}{
"status": "error",
"code": 422,
"name": "Unprocessable Entity",
"message": "<string>",
"info": {
"errors": {
"expiration_date": [
"Expiration date cannot be in the past."
]
}
}
}Update offer
Updates an existing offer. Only provided fields are updated. When a previously expired offer is reactivated (status set to active while expiration_date is in the past), the backend clears expiration by setting is_expires=0 and returning expiration_date as an empty string.
curl --request PUT \
--url https://{domain}/api/v2/network/offers/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"title": "string",
"status": 1,
"advertiser_id": 1,
"currency": "USD",
"external_id": "string"
}
'import requests
url = "https://{domain}/api/v2/network/offers/{id}"
payload = {
"title": "string",
"status": 1,
"advertiser_id": 1,
"currency": "USD",
"external_id": "string"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'string',
status: 1,
advertiser_id: 1,
currency: 'USD',
external_id: 'string'
})
};
fetch('https://{domain}/api/v2/network/offers/{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://{domain}/api/v2/network/offers/{id}",
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([
'title' => 'string',
'status' => 1,
'advertiser_id' => 1,
'currency' => 'USD',
'external_id' => 'string'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://{domain}/api/v2/network/offers/{id}"
payload := strings.NewReader("{\n \"title\": \"string\",\n \"status\": 1,\n \"advertiser_id\": 1,\n \"currency\": \"USD\",\n \"external_id\": \"string\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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://{domain}/api/v2/network/offers/{id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"string\",\n \"status\": 1,\n \"advertiser_id\": 1,\n \"currency\": \"USD\",\n \"external_id\": \"string\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/api/v2/network/offers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"string\",\n \"status\": 1,\n \"advertiser_id\": 1,\n \"currency\": \"USD\",\n \"external_id\": \"string\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"code": 200,
"name": "OK",
"message": "<string>",
"info": {
"offer": {}
}
}{
"status": "error",
"code": 422,
"name": "Unprocessable Entity",
"message": "<string>",
"info": {
"errors": {
"expiration_date": [
"Expiration date cannot be in the past."
]
}
}
}Authorizations
Preferred authentication method. Pass the API key in the X-API-Key HTTP request header. The user account must have api_status enabled.
Path Parameters
Offer ID.
Body
128Offer status to set: 1=active, 2=testing, 3=inactive, 6=draft. 5=deleted is additionally accepted on update, but it is not a status change: it performs the same write as DELETE /api/v2/network/offers/{id} and is one-way — the offer then returns 404 on GET, PUT and DELETE, and its urls, creatives and custom params become unreachable. Create Offer rejects 5 outright.
3Timezone identifier used to determine whether expiration_date is in the past.
0, 1 0, 1 Expiration date in Y-m-d format. When is_expires=1, must be today or a future date in the offer timezone.
0, 1 0, 1 0, 1 0, 1 0, 1 Was this page helpful?