curl --request PATCH \
--url https://inboxapp.com/api/v1/campaigns/{campaignId}/rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"syncedListIds": [
"l44e15irdq4db30i77cgphhx"
],
"excludedListIds": [
"kx9r3m7v2n1p5q8w4y6z0taj"
],
"excludeContacted": true,
"excludeMutuals": false,
"columnMappings": {
"l44e15irdq4db30i77cgphhx": {
"custom_q5cktl47a6pqa74eu06fz89v": "custom_m8r2xj93hd5bk0atcw7oe4fp"
}
},
"detachBehavior": "unlink"
}
'import requests
url = "https://inboxapp.com/api/v1/campaigns/{campaignId}/rules"
payload = {
"syncedListIds": ["l44e15irdq4db30i77cgphhx"],
"excludedListIds": ["kx9r3m7v2n1p5q8w4y6z0taj"],
"excludeContacted": True,
"excludeMutuals": False,
"columnMappings": { "l44e15irdq4db30i77cgphhx": { "custom_q5cktl47a6pqa74eu06fz89v": "custom_m8r2xj93hd5bk0atcw7oe4fp" } },
"detachBehavior": "unlink"
}
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({
syncedListIds: ['l44e15irdq4db30i77cgphhx'],
excludedListIds: ['kx9r3m7v2n1p5q8w4y6z0taj'],
excludeContacted: true,
excludeMutuals: false,
columnMappings: {
l44e15irdq4db30i77cgphhx: {custom_q5cktl47a6pqa74eu06fz89v: 'custom_m8r2xj93hd5bk0atcw7oe4fp'}
},
detachBehavior: 'unlink'
})
};
fetch('https://inboxapp.com/api/v1/campaigns/{campaignId}/rules', 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://inboxapp.com/api/v1/campaigns/{campaignId}/rules",
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([
'syncedListIds' => [
'l44e15irdq4db30i77cgphhx'
],
'excludedListIds' => [
'kx9r3m7v2n1p5q8w4y6z0taj'
],
'excludeContacted' => true,
'excludeMutuals' => false,
'columnMappings' => [
'l44e15irdq4db30i77cgphhx' => [
'custom_q5cktl47a6pqa74eu06fz89v' => 'custom_m8r2xj93hd5bk0atcw7oe4fp'
]
],
'detachBehavior' => 'unlink'
]),
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://inboxapp.com/api/v1/campaigns/{campaignId}/rules"
payload := strings.NewReader("{\n \"syncedListIds\": [\n \"l44e15irdq4db30i77cgphhx\"\n ],\n \"excludedListIds\": [\n \"kx9r3m7v2n1p5q8w4y6z0taj\"\n ],\n \"excludeContacted\": true,\n \"excludeMutuals\": false,\n \"columnMappings\": {\n \"l44e15irdq4db30i77cgphhx\": {\n \"custom_q5cktl47a6pqa74eu06fz89v\": \"custom_m8r2xj93hd5bk0atcw7oe4fp\"\n }\n },\n \"detachBehavior\": \"unlink\"\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://inboxapp.com/api/v1/campaigns/{campaignId}/rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"syncedListIds\": [\n \"l44e15irdq4db30i77cgphhx\"\n ],\n \"excludedListIds\": [\n \"kx9r3m7v2n1p5q8w4y6z0taj\"\n ],\n \"excludeContacted\": true,\n \"excludeMutuals\": false,\n \"columnMappings\": {\n \"l44e15irdq4db30i77cgphhx\": {\n \"custom_q5cktl47a6pqa74eu06fz89v\": \"custom_m8r2xj93hd5bk0atcw7oe4fp\"\n }\n },\n \"detachBehavior\": \"unlink\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inboxapp.com/api/v1/campaigns/{campaignId}/rules")
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 \"syncedListIds\": [\n \"l44e15irdq4db30i77cgphhx\"\n ],\n \"excludedListIds\": [\n \"kx9r3m7v2n1p5q8w4y6z0taj\"\n ],\n \"excludeContacted\": true,\n \"excludeMutuals\": false,\n \"columnMappings\": {\n \"l44e15irdq4db30i77cgphhx\": {\n \"custom_q5cktl47a6pqa74eu06fz89v\": \"custom_m8r2xj93hd5bk0atcw7oe4fp\"\n }\n },\n \"detachBehavior\": \"unlink\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}Update lead rules
Update the lead rules for a campaign. Lead rules determine which leads are automatically included or excluded.
Synced lists continuously feed leads into the campaign. When a lead is added to a synced list, it is added to the campaign. When a lead is removed from all synced lists that contributed it, it is also removed from the campaign.
Excluded lists prevent leads from being targeted. Leads in an excluded list are removed from the campaign even if they exist in a synced list.
Omitted fields are left unchanged. Pass an empty array to clear synced or excluded lists.
curl --request PATCH \
--url https://inboxapp.com/api/v1/campaigns/{campaignId}/rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"syncedListIds": [
"l44e15irdq4db30i77cgphhx"
],
"excludedListIds": [
"kx9r3m7v2n1p5q8w4y6z0taj"
],
"excludeContacted": true,
"excludeMutuals": false,
"columnMappings": {
"l44e15irdq4db30i77cgphhx": {
"custom_q5cktl47a6pqa74eu06fz89v": "custom_m8r2xj93hd5bk0atcw7oe4fp"
}
},
"detachBehavior": "unlink"
}
'import requests
url = "https://inboxapp.com/api/v1/campaigns/{campaignId}/rules"
payload = {
"syncedListIds": ["l44e15irdq4db30i77cgphhx"],
"excludedListIds": ["kx9r3m7v2n1p5q8w4y6z0taj"],
"excludeContacted": True,
"excludeMutuals": False,
"columnMappings": { "l44e15irdq4db30i77cgphhx": { "custom_q5cktl47a6pqa74eu06fz89v": "custom_m8r2xj93hd5bk0atcw7oe4fp" } },
"detachBehavior": "unlink"
}
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({
syncedListIds: ['l44e15irdq4db30i77cgphhx'],
excludedListIds: ['kx9r3m7v2n1p5q8w4y6z0taj'],
excludeContacted: true,
excludeMutuals: false,
columnMappings: {
l44e15irdq4db30i77cgphhx: {custom_q5cktl47a6pqa74eu06fz89v: 'custom_m8r2xj93hd5bk0atcw7oe4fp'}
},
detachBehavior: 'unlink'
})
};
fetch('https://inboxapp.com/api/v1/campaigns/{campaignId}/rules', 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://inboxapp.com/api/v1/campaigns/{campaignId}/rules",
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([
'syncedListIds' => [
'l44e15irdq4db30i77cgphhx'
],
'excludedListIds' => [
'kx9r3m7v2n1p5q8w4y6z0taj'
],
'excludeContacted' => true,
'excludeMutuals' => false,
'columnMappings' => [
'l44e15irdq4db30i77cgphhx' => [
'custom_q5cktl47a6pqa74eu06fz89v' => 'custom_m8r2xj93hd5bk0atcw7oe4fp'
]
],
'detachBehavior' => 'unlink'
]),
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://inboxapp.com/api/v1/campaigns/{campaignId}/rules"
payload := strings.NewReader("{\n \"syncedListIds\": [\n \"l44e15irdq4db30i77cgphhx\"\n ],\n \"excludedListIds\": [\n \"kx9r3m7v2n1p5q8w4y6z0taj\"\n ],\n \"excludeContacted\": true,\n \"excludeMutuals\": false,\n \"columnMappings\": {\n \"l44e15irdq4db30i77cgphhx\": {\n \"custom_q5cktl47a6pqa74eu06fz89v\": \"custom_m8r2xj93hd5bk0atcw7oe4fp\"\n }\n },\n \"detachBehavior\": \"unlink\"\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://inboxapp.com/api/v1/campaigns/{campaignId}/rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"syncedListIds\": [\n \"l44e15irdq4db30i77cgphhx\"\n ],\n \"excludedListIds\": [\n \"kx9r3m7v2n1p5q8w4y6z0taj\"\n ],\n \"excludeContacted\": true,\n \"excludeMutuals\": false,\n \"columnMappings\": {\n \"l44e15irdq4db30i77cgphhx\": {\n \"custom_q5cktl47a6pqa74eu06fz89v\": \"custom_m8r2xj93hd5bk0atcw7oe4fp\"\n }\n },\n \"detachBehavior\": \"unlink\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://inboxapp.com/api/v1/campaigns/{campaignId}/rules")
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 \"syncedListIds\": [\n \"l44e15irdq4db30i77cgphhx\"\n ],\n \"excludedListIds\": [\n \"kx9r3m7v2n1p5q8w4y6z0taj\"\n ],\n \"excludeContacted\": true,\n \"excludeMutuals\": false,\n \"columnMappings\": {\n \"l44e15irdq4db30i77cgphhx\": {\n \"custom_q5cktl47a6pqa74eu06fz89v\": \"custom_m8r2xj93hd5bk0atcw7oe4fp\"\n }\n },\n \"detachBehavior\": \"unlink\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the campaign.
^[0-9a-z]+$Body
List IDs to sync leads from. Leads in these lists are automatically added to the campaign and removed when they leave all synced lists.
^[0-9a-z]+$["l44e15irdq4db30i77cgphhx"]
User-created list IDs to exclude. Leads in these lists are removed from the campaign even if they appear in a synced list. Do not pass system list IDs here — use excludeContacted and excludeMutuals instead.
^[0-9a-z]+$["kx9r3m7v2n1p5q8w4y6z0taj"]
When true, leads you've already sent a direct message to are excluded from the campaign. Under the hood, this excludes the Contacted system list, which Inboxapp automatically maintains across all linked accounts.
true
When true, leads with a mutual conversation (at least one message sent and received) are excluded from the campaign. Under the hood, this excludes the Mutual system list, which Inboxapp automatically maintains across all linked accounts.
false
Custom column mappings keyed by source list ID. Each entry maps a source column ID to a campaign column ID. Only needed for custom columns — profile data is synced automatically. Columns must be created beforehand via the columns API. Unmapped source columns are ignored.
Show child attributes
Show child attributes
{
"l44e15irdq4db30i77cgphhx": {
"custom_q5cktl47a6pqa74eu06fz89v": "custom_m8r2xj93hd5bk0atcw7oe4fp"
}
}
Controls what happens to leads when their source list is detached. 'unlink' (default) keeps the leads in the campaign but removes the link to the source list. 'remove' removes leads that were only in the campaign because of the detached list.
unlink, remove "unlink"
Response
OK
Was this page helpful?