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",
"categories_ids": [
2,
36
],
"traffic_types_ids": [
1002,
1003
],
"traffic_types_denied_ids": [
1005
]
}
'import requests
url = "https://{domain}/api/v2/network/offers/{id}"
payload = {
"title": "string",
"status": 1,
"advertiser_id": 1,
"currency": "USD",
"external_id": "string",
"categories_ids": [2, 36],
"traffic_types_ids": [1002, 1003],
"traffic_types_denied_ids": [1005]
}
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',
categories_ids: [2, 36],
traffic_types_ids: [1002, 1003],
traffic_types_denied_ids: [1005]
})
};
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',
'categories_ids' => [
2,
36
],
'traffic_types_ids' => [
1002,
1003
],
'traffic_types_denied_ids' => [
1005
]
]),
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 \"categories_ids\": [\n 2,\n 36\n ],\n \"traffic_types_ids\": [\n 1002,\n 1003\n ],\n \"traffic_types_denied_ids\": [\n 1005\n ]\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 \"categories_ids\": [\n 2,\n 36\n ],\n \"traffic_types_ids\": [\n 1002,\n 1003\n ],\n \"traffic_types_denied_ids\": [\n 1005\n ]\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 \"categories_ids\": [\n 2,\n 36\n ],\n \"traffic_types_ids\": [\n 1002,\n 1003\n ],\n \"traffic_types_denied_ids\": [\n 1005\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"code": 200,
"name": "OK",
"message": "<string>",
"info": {
"details": {
"expiration_date": "<string>"
}
}
}{
"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 null.
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",
"categories_ids": [
2,
36
],
"traffic_types_ids": [
1002,
1003
],
"traffic_types_denied_ids": [
1005
]
}
'import requests
url = "https://{domain}/api/v2/network/offers/{id}"
payload = {
"title": "string",
"status": 1,
"advertiser_id": 1,
"currency": "USD",
"external_id": "string",
"categories_ids": [2, 36],
"traffic_types_ids": [1002, 1003],
"traffic_types_denied_ids": [1005]
}
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',
categories_ids: [2, 36],
traffic_types_ids: [1002, 1003],
traffic_types_denied_ids: [1005]
})
};
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',
'categories_ids' => [
2,
36
],
'traffic_types_ids' => [
1002,
1003
],
'traffic_types_denied_ids' => [
1005
]
]),
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 \"categories_ids\": [\n 2,\n 36\n ],\n \"traffic_types_ids\": [\n 1002,\n 1003\n ],\n \"traffic_types_denied_ids\": [\n 1005\n ]\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 \"categories_ids\": [\n 2,\n 36\n ],\n \"traffic_types_ids\": [\n 1002,\n 1003\n ],\n \"traffic_types_denied_ids\": [\n 1005\n ]\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 \"categories_ids\": [\n 2,\n 36\n ],\n \"traffic_types_ids\": [\n 1002,\n 1003\n ],\n \"traffic_types_denied_ids\": [\n 1005\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"code": 200,
"name": "OK",
"message": "<string>",
"info": {
"details": {
"expiration_date": "<string>"
}
}
}{
"status": "error",
"code": 422,
"name": "Unprocessable Entity",
"message": "<string>",
"info": {
"errors": {
"expiration_date": [
"Expiration date cannot be in the past."
]
}
}
}Authorizations
Body
Offer 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.
Expiration date in Y-m-d format. When is_expires=1, must be today or a future date in the offer timezone. The offer stops accepting traffic (clicks, impressions, conversions, smart links, promo codes, leads) at 00:00 of the following day in the offer timezone and is treated as Inactive from then on, even before its status is switched to Inactive. Events (registrations, deposits and other /track/event calls) for clicks made before that are still accepted, as they are for any Inactive offer.
Was this page helpful?