curl --request POST \
--url https://api.nexspace365.com/api/agent-builder/{id}/triggers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cronExpression": "<string>",
"timezone": "<string>",
"eventType": "<string>",
"eventFilters": {},
"runAsUserId": 123,
"facilityId": 123,
"seedMessage": "<string>",
"isActive": true
}
'import requests
url = "https://api.nexspace365.com/api/agent-builder/{id}/triggers"
payload = {
"cronExpression": "<string>",
"timezone": "<string>",
"eventType": "<string>",
"eventFilters": {},
"runAsUserId": 123,
"facilityId": 123,
"seedMessage": "<string>",
"isActive": True
}
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({
cronExpression: '<string>',
timezone: '<string>',
eventType: '<string>',
eventFilters: {},
runAsUserId: 123,
facilityId: 123,
seedMessage: '<string>',
isActive: true
})
};
fetch('https://api.nexspace365.com/api/agent-builder/{id}/triggers', 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.nexspace365.com/api/agent-builder/{id}/triggers",
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([
'cronExpression' => '<string>',
'timezone' => '<string>',
'eventType' => '<string>',
'eventFilters' => [
],
'runAsUserId' => 123,
'facilityId' => 123,
'seedMessage' => '<string>',
'isActive' => true
]),
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.nexspace365.com/api/agent-builder/{id}/triggers"
payload := strings.NewReader("{\n \"cronExpression\": \"<string>\",\n \"timezone\": \"<string>\",\n \"eventType\": \"<string>\",\n \"eventFilters\": {},\n \"runAsUserId\": 123,\n \"facilityId\": 123,\n \"seedMessage\": \"<string>\",\n \"isActive\": true\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.nexspace365.com/api/agent-builder/{id}/triggers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cronExpression\": \"<string>\",\n \"timezone\": \"<string>\",\n \"eventType\": \"<string>\",\n \"eventFilters\": {},\n \"runAsUserId\": 123,\n \"facilityId\": 123,\n \"seedMessage\": \"<string>\",\n \"isActive\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nexspace365.com/api/agent-builder/{id}/triggers")
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 \"cronExpression\": \"<string>\",\n \"timezone\": \"<string>\",\n \"eventType\": \"<string>\",\n \"eventFilters\": {},\n \"runAsUserId\": 123,\n \"facilityId\": 123,\n \"seedMessage\": \"<string>\",\n \"isActive\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"agentDefinitionId": 123,
"triggerType": "schedule",
"cronExpression": "<string>",
"timezone": "<string>",
"eventType": "<string>",
"eventFilters": {},
"runAsUserId": 123,
"facilityId": 123,
"seedMessage": "<string>",
"isActive": true,
"lastRunAt": "2023-11-07T05:31:56Z",
"nextRunAt": "2023-11-07T05:31:56Z",
"consecutiveFailures": 123
}Create an automation trigger
Create a schedule (cron) or event trigger. Schedule triggers require
a valid cronExpression; event triggers require an eventType. The
run acts as runAsUserId (defaults to the caller); binding another user
requires internal-operator privileges (privilege-escalation guard).
Consequential — writes an audit entry.
Dashboard surface — see GET /api/agent-builder/{id}/triggers.
curl --request POST \
--url https://api.nexspace365.com/api/agent-builder/{id}/triggers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cronExpression": "<string>",
"timezone": "<string>",
"eventType": "<string>",
"eventFilters": {},
"runAsUserId": 123,
"facilityId": 123,
"seedMessage": "<string>",
"isActive": true
}
'import requests
url = "https://api.nexspace365.com/api/agent-builder/{id}/triggers"
payload = {
"cronExpression": "<string>",
"timezone": "<string>",
"eventType": "<string>",
"eventFilters": {},
"runAsUserId": 123,
"facilityId": 123,
"seedMessage": "<string>",
"isActive": True
}
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({
cronExpression: '<string>',
timezone: '<string>',
eventType: '<string>',
eventFilters: {},
runAsUserId: 123,
facilityId: 123,
seedMessage: '<string>',
isActive: true
})
};
fetch('https://api.nexspace365.com/api/agent-builder/{id}/triggers', 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.nexspace365.com/api/agent-builder/{id}/triggers",
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([
'cronExpression' => '<string>',
'timezone' => '<string>',
'eventType' => '<string>',
'eventFilters' => [
],
'runAsUserId' => 123,
'facilityId' => 123,
'seedMessage' => '<string>',
'isActive' => true
]),
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.nexspace365.com/api/agent-builder/{id}/triggers"
payload := strings.NewReader("{\n \"cronExpression\": \"<string>\",\n \"timezone\": \"<string>\",\n \"eventType\": \"<string>\",\n \"eventFilters\": {},\n \"runAsUserId\": 123,\n \"facilityId\": 123,\n \"seedMessage\": \"<string>\",\n \"isActive\": true\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.nexspace365.com/api/agent-builder/{id}/triggers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cronExpression\": \"<string>\",\n \"timezone\": \"<string>\",\n \"eventType\": \"<string>\",\n \"eventFilters\": {},\n \"runAsUserId\": 123,\n \"facilityId\": 123,\n \"seedMessage\": \"<string>\",\n \"isActive\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.nexspace365.com/api/agent-builder/{id}/triggers")
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 \"cronExpression\": \"<string>\",\n \"timezone\": \"<string>\",\n \"eventType\": \"<string>\",\n \"eventFilters\": {},\n \"runAsUserId\": 123,\n \"facilityId\": 123,\n \"seedMessage\": \"<string>\",\n \"isActive\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"agentDefinitionId": 123,
"triggerType": "schedule",
"cronExpression": "<string>",
"timezone": "<string>",
"eventType": "<string>",
"eventFilters": {},
"runAsUserId": 123,
"facilityId": 123,
"seedMessage": "<string>",
"isActive": true,
"lastRunAt": "2023-11-07T05:31:56Z",
"nextRunAt": "2023-11-07T05:31:56Z",
"consecutiveFailures": 123
}Authorizations
JWT token authentication
Headers
Pin the request to a dated API version (e.g. 2026-05-10). Applied by app-level middleware to every /api route (server/routes/index.ts → apiVersionMiddleware), which echoes the resolved value back in the NexSpace-Version response header. Omit to get the latest version. Discover the catalog at GET /.well-known/api-versions.
^\d{4}-\d{2}-\d{2}$Replay guard for write requests. Applied by app-level middleware to every /api route (server/routes/index.ts → idempotencyMiddleware), which only acts on POST/PUT/PATCH — GET, DELETE and OPTIONS ignore the header. Re-sending the same key with an identical body within 24 hours replays the original response; the same key with a different body returns 409.
255Path Parameters
Body
Create/update payload for an automation trigger.
schedule, event, manual, webhook Required + validated for schedule triggers.
Required for event triggers.
Defaults to the caller; binding another user needs internal-operator rights.
Response
Trigger created
An automation trigger that fires an agent on a schedule or event.
schedule, event, manual, webhook 5-field cron; required for schedule triggers.
IANA timezone for cron evaluation (defaults to UTC).
Business event name; required for event triggers (e.g. shift.ncns).
Equality filters (dot-path) the event payload must satisfy.
Identity the run acts as (drives tool scope + RBAC).
Auto-disabled after 5 consecutive schedule-dispatch failures.

