Simulate the campaign audience
curl --request POST \
--url https://api.nuvia.ai/v1/campaigns/audience-preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"audience_config": {
"contact_ids": [
"<string>"
],
"lists": [
{
"id": "<string>",
"views": [
"<string>"
]
}
]
},
"behavior_config": {
"skip_if_active_conversation": true,
"active_conversation_window_minutes": 0
},
"exclusion_lists": [
{
"id": "<string>"
}
]
}
'import requests
url = "https://api.nuvia.ai/v1/campaigns/audience-preview"
payload = {
"audience_config": {
"contact_ids": ["<string>"],
"lists": [
{
"id": "<string>",
"views": ["<string>"]
}
]
},
"behavior_config": {
"skip_if_active_conversation": True,
"active_conversation_window_minutes": 0
},
"exclusion_lists": [{ "id": "<string>" }]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
audience_config: {contact_ids: ['<string>'], lists: [{id: '<string>', views: ['<string>']}]},
behavior_config: {skip_if_active_conversation: true, active_conversation_window_minutes: 0},
exclusion_lists: [{id: '<string>'}]
})
};
fetch('https://api.nuvia.ai/v1/campaigns/audience-preview', 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.nuvia.ai/v1/campaigns/audience-preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'audience_config' => [
'contact_ids' => [
'<string>'
],
'lists' => [
[
'id' => '<string>',
'views' => [
'<string>'
]
]
]
],
'behavior_config' => [
'skip_if_active_conversation' => true,
'active_conversation_window_minutes' => 0
],
'exclusion_lists' => [
[
'id' => '<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://api.nuvia.ai/v1/campaigns/audience-preview"
payload := strings.NewReader("{\n \"audience_config\": {\n \"contact_ids\": [\n \"<string>\"\n ],\n \"lists\": [\n {\n \"id\": \"<string>\",\n \"views\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"behavior_config\": {\n \"skip_if_active_conversation\": true,\n \"active_conversation_window_minutes\": 0\n },\n \"exclusion_lists\": [\n {\n \"id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.nuvia.ai/v1/campaigns/audience-preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"audience_config\": {\n \"contact_ids\": [\n \"<string>\"\n ],\n \"lists\": [\n {\n \"id\": \"<string>\",\n \"views\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"behavior_config\": {\n \"skip_if_active_conversation\": true,\n \"active_conversation_window_minutes\": 0\n },\n \"exclusion_lists\": [\n {\n \"id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nuvia.ai/v1/campaigns/audience-preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"audience_config\": {\n \"contact_ids\": [\n \"<string>\"\n ],\n \"lists\": [\n {\n \"id\": \"<string>\",\n \"views\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"behavior_config\": {\n \"skip_if_active_conversation\": true,\n \"active_conversation_window_minutes\": 0\n },\n \"exclusion_lists\": [\n {\n \"id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{}Campanhas
Simulate the campaign audience
Counts the contacts that would be enrolled, with per-channel validation. No enrollment is created.
POST
/
v1
/
campaigns
/
audience-preview
Simulate the campaign audience
curl --request POST \
--url https://api.nuvia.ai/v1/campaigns/audience-preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"audience_config": {
"contact_ids": [
"<string>"
],
"lists": [
{
"id": "<string>",
"views": [
"<string>"
]
}
]
},
"behavior_config": {
"skip_if_active_conversation": true,
"active_conversation_window_minutes": 0
},
"exclusion_lists": [
{
"id": "<string>"
}
]
}
'import requests
url = "https://api.nuvia.ai/v1/campaigns/audience-preview"
payload = {
"audience_config": {
"contact_ids": ["<string>"],
"lists": [
{
"id": "<string>",
"views": ["<string>"]
}
]
},
"behavior_config": {
"skip_if_active_conversation": True,
"active_conversation_window_minutes": 0
},
"exclusion_lists": [{ "id": "<string>" }]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
audience_config: {contact_ids: ['<string>'], lists: [{id: '<string>', views: ['<string>']}]},
behavior_config: {skip_if_active_conversation: true, active_conversation_window_minutes: 0},
exclusion_lists: [{id: '<string>'}]
})
};
fetch('https://api.nuvia.ai/v1/campaigns/audience-preview', 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.nuvia.ai/v1/campaigns/audience-preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'audience_config' => [
'contact_ids' => [
'<string>'
],
'lists' => [
[
'id' => '<string>',
'views' => [
'<string>'
]
]
]
],
'behavior_config' => [
'skip_if_active_conversation' => true,
'active_conversation_window_minutes' => 0
],
'exclusion_lists' => [
[
'id' => '<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://api.nuvia.ai/v1/campaigns/audience-preview"
payload := strings.NewReader("{\n \"audience_config\": {\n \"contact_ids\": [\n \"<string>\"\n ],\n \"lists\": [\n {\n \"id\": \"<string>\",\n \"views\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"behavior_config\": {\n \"skip_if_active_conversation\": true,\n \"active_conversation_window_minutes\": 0\n },\n \"exclusion_lists\": [\n {\n \"id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.nuvia.ai/v1/campaigns/audience-preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"audience_config\": {\n \"contact_ids\": [\n \"<string>\"\n ],\n \"lists\": [\n {\n \"id\": \"<string>\",\n \"views\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"behavior_config\": {\n \"skip_if_active_conversation\": true,\n \"active_conversation_window_minutes\": 0\n },\n \"exclusion_lists\": [\n {\n \"id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nuvia.ai/v1/campaigns/audience-preview")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"audience_config\": {\n \"contact_ids\": [\n \"<string>\"\n ],\n \"lists\": [\n {\n \"id\": \"<string>\",\n \"views\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"behavior_config\": {\n \"skip_if_active_conversation\": true,\n \"active_conversation_window_minutes\": 0\n },\n \"exclusion_lists\": [\n {\n \"id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{}Authorizations
JWT authentication token
Headers
Target company identifier. Required only for global API keys (type=global). Ignored for company API keys and human users.
Body
application/json
The campaign's sending channel. Defines the per-channel validation.
Available options:
WAP_AUTO_CLOSER, WEB_V2, EVOLUTION_API, LINKEDIN, MULTI_CHANNEL Simulated audience, in the same format as campaign creation.
Show child attributes
Show child attributes
Open conversation rule, as configured on the screen.
Show child attributes
Show child attributes
Exclusion lists, in the order they were added. Anyone in them is left out.
Show child attributes
Show child attributes
Response
201 - application/json
The response is of type object.