Change a running campaign, safely
curl --request PATCH \
--url https://apiv2.vodex.ai/v1/contacts/campaigns/{id}/live \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"concurrency": 123,
"retry": {
"on": [
"<string>"
],
"attempts": 5,
"backoffMinutes": 5040.5
},
"window": {
"timezone": "America/New_York",
"start": "09:00",
"end": "20:00",
"days": [
3
]
},
"startAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://apiv2.vodex.ai/v1/contacts/campaigns/{id}/live"
payload = {
"concurrency": 123,
"retry": {
"on": ["<string>"],
"attempts": 5,
"backoffMinutes": 5040.5
},
"window": {
"timezone": "America/New_York",
"start": "09:00",
"end": "20:00",
"days": [3]
},
"startAt": "2023-11-07T05:31:56Z"
}
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({
concurrency: 123,
retry: {on: ['<string>'], attempts: 5, backoffMinutes: 5040.5},
window: {timezone: 'America/New_York', start: '09:00', end: '20:00', days: [3]},
startAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://apiv2.vodex.ai/v1/contacts/campaigns/{id}/live', 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://apiv2.vodex.ai/v1/contacts/campaigns/{id}/live",
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([
'concurrency' => 123,
'retry' => [
'on' => [
'<string>'
],
'attempts' => 5,
'backoffMinutes' => 5040.5
],
'window' => [
'timezone' => 'America/New_York',
'start' => '09:00',
'end' => '20:00',
'days' => [
3
]
],
'startAt' => '2023-11-07T05:31:56Z'
]),
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://apiv2.vodex.ai/v1/contacts/campaigns/{id}/live"
payload := strings.NewReader("{\n \"concurrency\": 123,\n \"retry\": {\n \"on\": [\n \"<string>\"\n ],\n \"attempts\": 5,\n \"backoffMinutes\": 5040.5\n },\n \"window\": {\n \"timezone\": \"America/New_York\",\n \"start\": \"09:00\",\n \"end\": \"20:00\",\n \"days\": [\n 3\n ]\n },\n \"startAt\": \"2023-11-07T05:31:56Z\"\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://apiv2.vodex.ai/v1/contacts/campaigns/{id}/live")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"concurrency\": 123,\n \"retry\": {\n \"on\": [\n \"<string>\"\n ],\n \"attempts\": 5,\n \"backoffMinutes\": 5040.5\n },\n \"window\": {\n \"timezone\": \"America/New_York\",\n \"start\": \"09:00\",\n \"end\": \"20:00\",\n \"days\": [\n 3\n ]\n },\n \"startAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.vodex.ai/v1/contacts/campaigns/{id}/live")
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 \"concurrency\": 123,\n \"retry\": {\n \"on\": [\n \"<string>\"\n ],\n \"attempts\": 5,\n \"backoffMinutes\": 5040.5\n },\n \"window\": {\n \"timezone\": \"America/New_York\",\n \"start\": \"09:00\",\n \"end\": \"20:00\",\n \"days\": [\n 3\n ]\n },\n \"startAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"audienceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assistantId": "<string>",
"status": "<string>",
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"startAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "not found"
}{
"error": "not found"
}Campaigns
Change a running campaign, safely
A narrow whitelist — concurrency, retry, calling window, start time — applied to a campaign that is already running or scheduled.
A separate route rather than a looser PATCH, because a client sends
its whole form on every save: a whitelist on the main route would have
to be a diff, comparing JSONB for semantic equality against a client
that round-trips it, and every false positive would be a 409 nobody
could explain.
A scheduled campaign is running with a future start, so this is also
how “reschedule it” is expressed.
PATCH
/
contacts
/
campaigns
/
{id}
/
live
Change a running campaign, safely
curl --request PATCH \
--url https://apiv2.vodex.ai/v1/contacts/campaigns/{id}/live \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"concurrency": 123,
"retry": {
"on": [
"<string>"
],
"attempts": 5,
"backoffMinutes": 5040.5
},
"window": {
"timezone": "America/New_York",
"start": "09:00",
"end": "20:00",
"days": [
3
]
},
"startAt": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://apiv2.vodex.ai/v1/contacts/campaigns/{id}/live"
payload = {
"concurrency": 123,
"retry": {
"on": ["<string>"],
"attempts": 5,
"backoffMinutes": 5040.5
},
"window": {
"timezone": "America/New_York",
"start": "09:00",
"end": "20:00",
"days": [3]
},
"startAt": "2023-11-07T05:31:56Z"
}
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({
concurrency: 123,
retry: {on: ['<string>'], attempts: 5, backoffMinutes: 5040.5},
window: {timezone: 'America/New_York', start: '09:00', end: '20:00', days: [3]},
startAt: '2023-11-07T05:31:56Z'
})
};
fetch('https://apiv2.vodex.ai/v1/contacts/campaigns/{id}/live', 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://apiv2.vodex.ai/v1/contacts/campaigns/{id}/live",
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([
'concurrency' => 123,
'retry' => [
'on' => [
'<string>'
],
'attempts' => 5,
'backoffMinutes' => 5040.5
],
'window' => [
'timezone' => 'America/New_York',
'start' => '09:00',
'end' => '20:00',
'days' => [
3
]
],
'startAt' => '2023-11-07T05:31:56Z'
]),
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://apiv2.vodex.ai/v1/contacts/campaigns/{id}/live"
payload := strings.NewReader("{\n \"concurrency\": 123,\n \"retry\": {\n \"on\": [\n \"<string>\"\n ],\n \"attempts\": 5,\n \"backoffMinutes\": 5040.5\n },\n \"window\": {\n \"timezone\": \"America/New_York\",\n \"start\": \"09:00\",\n \"end\": \"20:00\",\n \"days\": [\n 3\n ]\n },\n \"startAt\": \"2023-11-07T05:31:56Z\"\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://apiv2.vodex.ai/v1/contacts/campaigns/{id}/live")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"concurrency\": 123,\n \"retry\": {\n \"on\": [\n \"<string>\"\n ],\n \"attempts\": 5,\n \"backoffMinutes\": 5040.5\n },\n \"window\": {\n \"timezone\": \"America/New_York\",\n \"start\": \"09:00\",\n \"end\": \"20:00\",\n \"days\": [\n 3\n ]\n },\n \"startAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.vodex.ai/v1/contacts/campaigns/{id}/live")
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 \"concurrency\": 123,\n \"retry\": {\n \"on\": [\n \"<string>\"\n ],\n \"attempts\": 5,\n \"backoffMinutes\": 5040.5\n },\n \"window\": {\n \"timezone\": \"America/New_York\",\n \"start\": \"09:00\",\n \"end\": \"20:00\",\n \"days\": [\n 3\n ]\n },\n \"startAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"audienceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assistantId": "<string>",
"status": "<string>",
"batchId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"startAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z"
}{
"error": "not found"
}{
"error": "not found"
}Authorizations
Tenant API key (vdx_live_…) as Authorization: Bearer.
Path Parameters
Body
application/json