Run a Scheduled Function Now
curl --request POST \
--url https://api.getnexor.ai/api/public/scheduled-functions/{id}/run \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{
"ctx": {}
}'import requests
url = "https://api.getnexor.ai/api/public/scheduled-functions/{id}/run"
payload = { "ctx": {} }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({ctx: {}})
};
fetch('https://api.getnexor.ai/api/public/scheduled-functions/{id}/run', 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/scheduled-functions/{id}/run",
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([
'ctx' => [
]
]),
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/scheduled-functions/{id}/run"
payload := strings.NewReader("{\n \"ctx\": {}\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.getnexor.ai/api/public/scheduled-functions/{id}/run")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"ctx\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getnexor.ai/api/public/scheduled-functions/{id}/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ctx\": {}\n}"
response = http.request(request)
puts response.read_body{
"effects_may_apply": true,
"run": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scheduled_function_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"function_name": "<string>",
"status": "success",
"trigger_source": "<string>",
"duration_ms": 123,
"candidates_found": 123,
"effects_applied": 123,
"effects_failed": 123,
"log_count": 123,
"error": "<unknown>",
"result": "<unknown>",
"has_result": true,
"scheduled_for": "2023-11-07T05:31:56Z",
"ran_at": "2023-11-07T05:31:56Z",
"script_name": "<string>",
"client_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cron_expression": "<string>",
"timezone": "<string>",
"logs": [
"<unknown>"
],
"effects": [
"<unknown>"
],
"requests": [
"<unknown>"
],
"ctx": "<unknown>",
"mode": "production"
},
"deploy_error": "<string>",
"success": "<unknown>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<unknown>",
"message": "<unknown>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<unknown>",
"message": "<unknown>"
}{
"error": "Service unavailable",
"message": "Function deployment is not current; retry after deployment succeeds",
"code": "DEPLOYMENT_NOT_CURRENT",
"detail": "upload failed"
}Ejecutar una función programada ahora
Ejecuta ahora la versión publicada de una función programada, con efectos reales, sin esperar su próximo horario. Un borrador pendiente no se incluye. Esta referencia documenta campos verificados de ruta, consulta y cuerpo JSON de nivel superior, códigos de estado observados y campos de respuesta de nivel superior. Las respuestas del proveedor o con estructuras anidadas profundas pueden permanecer abiertas.
POST
/
scheduled-functions
/
{id}
/
run
Run a Scheduled Function Now
curl --request POST \
--url https://api.getnexor.ai/api/public/scheduled-functions/{id}/run \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{
"ctx": {}
}'import requests
url = "https://api.getnexor.ai/api/public/scheduled-functions/{id}/run"
payload = { "ctx": {} }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({ctx: {}})
};
fetch('https://api.getnexor.ai/api/public/scheduled-functions/{id}/run', 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/scheduled-functions/{id}/run",
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([
'ctx' => [
]
]),
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/scheduled-functions/{id}/run"
payload := strings.NewReader("{\n \"ctx\": {}\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.getnexor.ai/api/public/scheduled-functions/{id}/run")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"ctx\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getnexor.ai/api/public/scheduled-functions/{id}/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ctx\": {}\n}"
response = http.request(request)
puts response.read_body{
"effects_may_apply": true,
"run": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scheduled_function_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"function_name": "<string>",
"status": "success",
"trigger_source": "<string>",
"duration_ms": 123,
"candidates_found": 123,
"effects_applied": 123,
"effects_failed": 123,
"log_count": 123,
"error": "<unknown>",
"result": "<unknown>",
"has_result": true,
"scheduled_for": "2023-11-07T05:31:56Z",
"ran_at": "2023-11-07T05:31:56Z",
"script_name": "<string>",
"client_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cron_expression": "<string>",
"timezone": "<string>",
"logs": [
"<unknown>"
],
"effects": [
"<unknown>"
],
"requests": [
"<unknown>"
],
"ctx": "<unknown>",
"mode": "production"
},
"deploy_error": "<string>",
"success": "<unknown>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<unknown>",
"message": "<unknown>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<unknown>",
"message": "<unknown>"
}{
"error": "Service unavailable",
"message": "Function deployment is not current; retry after deployment succeeds",
"code": "DEPLOYMENT_NOT_CURRENT",
"detail": "upload failed"
}Notas de seguridad y comportamiento
- Un objeto ctx enviado por el cliente omite una consulta nueva del lead, agente o host.
- REST directo no tiene barrera de confirmación. Enviar confirm=false no impide la ejecución porque confirm se ignora.
- La función se ejecuta de inmediato y aplica efectos almacenados en búfer a datos reales del tenant. Un override de ctx omite la consulta normal de cohorte.
- Solo ejecuta la versión publicada, nunca un borrador pendiente. Si esa versión no se puede desplegar, devuelve HTTP 503 y no ejecuta nada.
Autorizaciones
API key for authentication. Keys are prefixed with nxr_live_.
Parámetros de ruta
Scheduled Function id.
Cuerpo
application/json
Optional full context override. When present as an object, normal lead/agent/host lookup is bypassed.
Última modificación el 6 de octubre de 2026
⌘I