curl --request PATCH \
--url https://api.getnexor.ai/api/public/background-jobs/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"cron_expression": "<string>",
"lead_filters": [
{}
],
"steps": [
{
"conditions": [
{}
],
"on_match": {},
"on_no_match": {},
"action": {}
}
],
"max_leads_per_cycle": 123,
"cooldown_minutes": 123,
"dry_run": true,
"is_active": true
}
'import requests
url = "https://api.getnexor.ai/api/public/background-jobs/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"cron_expression": "<string>",
"lead_filters": [{}],
"steps": [
{
"conditions": [{}],
"on_match": {},
"on_no_match": {},
"action": {}
}
],
"max_leads_per_cycle": 123,
"cooldown_minutes": 123,
"dry_run": True,
"is_active": True
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
cron_expression: '<string>',
lead_filters: [{}],
steps: [{conditions: [{}], on_match: {}, on_no_match: {}, action: {}}],
max_leads_per_cycle: 123,
cooldown_minutes: 123,
dry_run: true,
is_active: true
})
};
fetch('https://api.getnexor.ai/api/public/background-jobs/{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://api.getnexor.ai/api/public/background-jobs/{id}",
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([
'name' => '<string>',
'description' => '<string>',
'cron_expression' => '<string>',
'lead_filters' => [
[
]
],
'steps' => [
[
'conditions' => [
[
]
],
'on_match' => [
],
'on_no_match' => [
],
'action' => [
]
]
],
'max_leads_per_cycle' => 123,
'cooldown_minutes' => 123,
'dry_run' => true,
'is_active' => true
]),
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://api.getnexor.ai/api/public/background-jobs/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"cron_expression\": \"<string>\",\n \"lead_filters\": [\n {}\n ],\n \"steps\": [\n {\n \"conditions\": [\n {}\n ],\n \"on_match\": {},\n \"on_no_match\": {},\n \"action\": {}\n }\n ],\n \"max_leads_per_cycle\": 123,\n \"cooldown_minutes\": 123,\n \"dry_run\": true,\n \"is_active\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.getnexor.ai/api/public/background-jobs/{id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"cron_expression\": \"<string>\",\n \"lead_filters\": [\n {}\n ],\n \"steps\": [\n {\n \"conditions\": [\n {}\n ],\n \"on_match\": {},\n \"on_no_match\": {},\n \"action\": {}\n }\n ],\n \"max_leads_per_cycle\": 123,\n \"cooldown_minutes\": 123,\n \"dry_run\": true,\n \"is_active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getnexor.ai/api/public/background-jobs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"cron_expression\": \"<string>\",\n \"lead_filters\": [\n {}\n ],\n \"steps\": [\n {\n \"conditions\": [\n {}\n ],\n \"on_match\": {},\n \"on_no_match\": {},\n \"action\": {}\n }\n ],\n \"max_leads_per_cycle\": 123,\n \"cooldown_minutes\": 123,\n \"dry_run\": true,\n \"is_active\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"steps": [
{
"conditions": [
{}
],
"on_match": {},
"on_no_match": {},
"action": {}
}
],
"is_active": true,
"description": "<string>",
"cron_expression": "<string>",
"lead_filters": [
{}
],
"workflow_filters": "<unknown>",
"max_leads_per_cycle": 123,
"cooldown_minutes": 123,
"dry_run": true,
"created_at": "2023-11-07T05:31:56Z",
"last_executed_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Update Background Job
Update any subset of a background job’s config (steps, filters, schedule, is_active, …).
curl --request PATCH \
--url https://api.getnexor.ai/api/public/background-jobs/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"cron_expression": "<string>",
"lead_filters": [
{}
],
"steps": [
{
"conditions": [
{}
],
"on_match": {},
"on_no_match": {},
"action": {}
}
],
"max_leads_per_cycle": 123,
"cooldown_minutes": 123,
"dry_run": true,
"is_active": true
}
'import requests
url = "https://api.getnexor.ai/api/public/background-jobs/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"cron_expression": "<string>",
"lead_filters": [{}],
"steps": [
{
"conditions": [{}],
"on_match": {},
"on_no_match": {},
"action": {}
}
],
"max_leads_per_cycle": 123,
"cooldown_minutes": 123,
"dry_run": True,
"is_active": True
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
cron_expression: '<string>',
lead_filters: [{}],
steps: [{conditions: [{}], on_match: {}, on_no_match: {}, action: {}}],
max_leads_per_cycle: 123,
cooldown_minutes: 123,
dry_run: true,
is_active: true
})
};
fetch('https://api.getnexor.ai/api/public/background-jobs/{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://api.getnexor.ai/api/public/background-jobs/{id}",
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([
'name' => '<string>',
'description' => '<string>',
'cron_expression' => '<string>',
'lead_filters' => [
[
]
],
'steps' => [
[
'conditions' => [
[
]
],
'on_match' => [
],
'on_no_match' => [
],
'action' => [
]
]
],
'max_leads_per_cycle' => 123,
'cooldown_minutes' => 123,
'dry_run' => true,
'is_active' => true
]),
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://api.getnexor.ai/api/public/background-jobs/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"cron_expression\": \"<string>\",\n \"lead_filters\": [\n {}\n ],\n \"steps\": [\n {\n \"conditions\": [\n {}\n ],\n \"on_match\": {},\n \"on_no_match\": {},\n \"action\": {}\n }\n ],\n \"max_leads_per_cycle\": 123,\n \"cooldown_minutes\": 123,\n \"dry_run\": true,\n \"is_active\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.getnexor.ai/api/public/background-jobs/{id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"cron_expression\": \"<string>\",\n \"lead_filters\": [\n {}\n ],\n \"steps\": [\n {\n \"conditions\": [\n {}\n ],\n \"on_match\": {},\n \"on_no_match\": {},\n \"action\": {}\n }\n ],\n \"max_leads_per_cycle\": 123,\n \"cooldown_minutes\": 123,\n \"dry_run\": true,\n \"is_active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getnexor.ai/api/public/background-jobs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"cron_expression\": \"<string>\",\n \"lead_filters\": [\n {}\n ],\n \"steps\": [\n {\n \"conditions\": [\n {}\n ],\n \"on_match\": {},\n \"on_no_match\": {},\n \"action\": {}\n }\n ],\n \"max_leads_per_cycle\": 123,\n \"cooldown_minutes\": 123,\n \"dry_run\": true,\n \"is_active\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"steps": [
{
"conditions": [
{}
],
"on_match": {},
"on_no_match": {},
"action": {}
}
],
"is_active": true,
"description": "<string>",
"cron_expression": "<string>",
"lead_filters": [
{}
],
"workflow_filters": "<unknown>",
"max_leads_per_cycle": 123,
"cooldown_minutes": 123,
"dry_run": true,
"created_at": "2023-11-07T05:31:56Z",
"last_executed_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
API key for authentication. Keys are prefixed with nxr_live_.
Path Parameters
Background job ID.
Body
Any subset of the job's config. Validated server-side.
1-3 steps run on each candidate lead. Each step is one of: (1) {type:'evaluate_metadata'|'evaluate_field', conditions:[{field, operator, format?, value?}], on_match, on_no_match} — evaluate a lead.metadata key (evaluate_metadata) or a collected funnel field/variable (evaluate_field); operator: date_before_today | date_after_today (need format 'DD/MM/YYYY'|'YYYY-MM-DD'|'MM/DD/YYYY') | equals | not_equals | greater_than | less_than | exists | not_exists. (2) {type:'evaluate_tag', conditions:[{type:'date_in_tag', match_value, date_format, trigger_when:'future'|'past'}], on_match, on_no_match}. (3) {type:'action', action:} — run an action for every candidate (no condition). An is one of: {type:'send_message', channel:'whatsapp', template_name, then_status_key?} — sends an APPROVED WhatsApp template; its variables (incl. a dynamic {{link}}) resolve via the workflow's template_var_tools; then_status_key moves the lead to that status after sending (use it for 'send exactly once'); {type:'set_lead_status', status_key}; {type:'assign_workflow', workflow_id}; {type:'workflow_transfer', target_workflow_id}; {type:'enrich_lead', ...}.
Show child attributes
Show child attributes
Response
Background job updated
Show child attributes
Show child attributes