Create an Agent
curl --request POST \
--url https://api.getnexor.ai/api/public/workflows \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"statuses": [
{
"key": "<string>",
"name": "<string>",
"label": "<string>",
"is_initial": false,
"is_terminal": false,
"sort_order": 123,
"entry_hint": "<string>",
"category": "<string>",
"color": "<string>",
"is_auto_contacted": false,
"is_auto_engaged": false,
"is_booking_target": false,
"is_qualified": false,
"requires_all_fields": false,
"pause_bot": false,
"required_field_keys": [
"<string>"
],
"transition_rules": {},
"timeout_config": {
"timeout": 1,
"target_status_key": "<string>"
},
"transfer_config": {
"target_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"assignment_config": {}
}
],
"master_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_name": "<string>",
"agent_role": "<string>",
"company_name": "<string>",
"begin_message": "<string>",
"timezone": "<string>",
"global_prompt": "<string>",
"channels": [],
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "text",
"required": false,
"options": [
"<string>"
],
"extraction_hints": "<string>",
"sort_order": 123,
"metadata_key": "<string>",
"intake_value_map": {}
}
],
"description": "<string>"
}
'import requests
url = "https://api.getnexor.ai/api/public/workflows"
payload = {
"name": "<string>",
"statuses": [
{
"key": "<string>",
"name": "<string>",
"label": "<string>",
"is_initial": False,
"is_terminal": False,
"sort_order": 123,
"entry_hint": "<string>",
"category": "<string>",
"color": "<string>",
"is_auto_contacted": False,
"is_auto_engaged": False,
"is_booking_target": False,
"is_qualified": False,
"requires_all_fields": False,
"pause_bot": False,
"required_field_keys": ["<string>"],
"transition_rules": {},
"timeout_config": {
"timeout": 1,
"target_status_key": "<string>"
},
"transfer_config": { "target_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" },
"assignment_config": {}
}
],
"master_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_name": "<string>",
"agent_role": "<string>",
"company_name": "<string>",
"begin_message": "<string>",
"timezone": "<string>",
"global_prompt": "<string>",
"channels": [],
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "text",
"required": False,
"options": ["<string>"],
"extraction_hints": "<string>",
"sort_order": 123,
"metadata_key": "<string>",
"intake_value_map": {}
}
],
"description": "<string>"
}
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({
name: '<string>',
statuses: [
{
key: '<string>',
name: '<string>',
label: '<string>',
is_initial: false,
is_terminal: false,
sort_order: 123,
entry_hint: '<string>',
category: '<string>',
color: '<string>',
is_auto_contacted: false,
is_auto_engaged: false,
is_booking_target: false,
is_qualified: false,
requires_all_fields: false,
pause_bot: false,
required_field_keys: ['<string>'],
transition_rules: {},
timeout_config: {timeout: 1, target_status_key: '<string>'},
transfer_config: {target_workflow_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'},
assignment_config: {}
}
],
master_workflow_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
agent_name: '<string>',
agent_role: '<string>',
company_name: '<string>',
begin_message: '<string>',
timezone: '<string>',
global_prompt: '<string>',
channels: [],
fields: [
{
key: '<string>',
label: '<string>',
type: 'text',
required: false,
options: ['<string>'],
extraction_hints: '<string>',
sort_order: 123,
metadata_key: '<string>',
intake_value_map: {}
}
],
description: '<string>'
})
};
fetch('https://api.getnexor.ai/api/public/workflows', 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/workflows",
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([
'name' => '<string>',
'statuses' => [
[
'key' => '<string>',
'name' => '<string>',
'label' => '<string>',
'is_initial' => false,
'is_terminal' => false,
'sort_order' => 123,
'entry_hint' => '<string>',
'category' => '<string>',
'color' => '<string>',
'is_auto_contacted' => false,
'is_auto_engaged' => false,
'is_booking_target' => false,
'is_qualified' => false,
'requires_all_fields' => false,
'pause_bot' => false,
'required_field_keys' => [
'<string>'
],
'transition_rules' => [
],
'timeout_config' => [
'timeout' => 1,
'target_status_key' => '<string>'
],
'transfer_config' => [
'target_workflow_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'assignment_config' => [
]
]
],
'master_workflow_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'agent_name' => '<string>',
'agent_role' => '<string>',
'company_name' => '<string>',
'begin_message' => '<string>',
'timezone' => '<string>',
'global_prompt' => '<string>',
'channels' => [
],
'fields' => [
[
'key' => '<string>',
'label' => '<string>',
'type' => 'text',
'required' => false,
'options' => [
'<string>'
],
'extraction_hints' => '<string>',
'sort_order' => 123,
'metadata_key' => '<string>',
'intake_value_map' => [
]
]
],
'description' => '<string>'
]),
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/workflows"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"is_initial\": false,\n \"is_terminal\": false,\n \"sort_order\": 123,\n \"entry_hint\": \"<string>\",\n \"category\": \"<string>\",\n \"color\": \"<string>\",\n \"is_auto_contacted\": false,\n \"is_auto_engaged\": false,\n \"is_booking_target\": false,\n \"is_qualified\": false,\n \"requires_all_fields\": false,\n \"pause_bot\": false,\n \"required_field_keys\": [\n \"<string>\"\n ],\n \"transition_rules\": {},\n \"timeout_config\": {\n \"timeout\": 1,\n \"target_status_key\": \"<string>\"\n },\n \"transfer_config\": {\n \"target_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"assignment_config\": {}\n }\n ],\n \"master_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_name\": \"<string>\",\n \"agent_role\": \"<string>\",\n \"company_name\": \"<string>\",\n \"begin_message\": \"<string>\",\n \"timezone\": \"<string>\",\n \"global_prompt\": \"<string>\",\n \"channels\": [],\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"text\",\n \"required\": false,\n \"options\": [\n \"<string>\"\n ],\n \"extraction_hints\": \"<string>\",\n \"sort_order\": 123,\n \"metadata_key\": \"<string>\",\n \"intake_value_map\": {}\n }\n ],\n \"description\": \"<string>\"\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/workflows")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"is_initial\": false,\n \"is_terminal\": false,\n \"sort_order\": 123,\n \"entry_hint\": \"<string>\",\n \"category\": \"<string>\",\n \"color\": \"<string>\",\n \"is_auto_contacted\": false,\n \"is_auto_engaged\": false,\n \"is_booking_target\": false,\n \"is_qualified\": false,\n \"requires_all_fields\": false,\n \"pause_bot\": false,\n \"required_field_keys\": [\n \"<string>\"\n ],\n \"transition_rules\": {},\n \"timeout_config\": {\n \"timeout\": 1,\n \"target_status_key\": \"<string>\"\n },\n \"transfer_config\": {\n \"target_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"assignment_config\": {}\n }\n ],\n \"master_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_name\": \"<string>\",\n \"agent_role\": \"<string>\",\n \"company_name\": \"<string>\",\n \"begin_message\": \"<string>\",\n \"timezone\": \"<string>\",\n \"global_prompt\": \"<string>\",\n \"channels\": [],\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"text\",\n \"required\": false,\n \"options\": [\n \"<string>\"\n ],\n \"extraction_hints\": \"<string>\",\n \"sort_order\": 123,\n \"metadata_key\": \"<string>\",\n \"intake_value_map\": {}\n }\n ],\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getnexor.ai/api/public/workflows")
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 \"name\": \"<string>\",\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"is_initial\": false,\n \"is_terminal\": false,\n \"sort_order\": 123,\n \"entry_hint\": \"<string>\",\n \"category\": \"<string>\",\n \"color\": \"<string>\",\n \"is_auto_contacted\": false,\n \"is_auto_engaged\": false,\n \"is_booking_target\": false,\n \"is_qualified\": false,\n \"requires_all_fields\": false,\n \"pause_bot\": false,\n \"required_field_keys\": [\n \"<string>\"\n ],\n \"transition_rules\": {},\n \"timeout_config\": {\n \"timeout\": 1,\n \"target_status_key\": \"<string>\"\n },\n \"transfer_config\": {\n \"target_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"assignment_config\": {}\n }\n ],\n \"master_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_name\": \"<string>\",\n \"agent_role\": \"<string>\",\n \"company_name\": \"<string>\",\n \"begin_message\": \"<string>\",\n \"timezone\": \"<string>\",\n \"global_prompt\": \"<string>\",\n \"channels\": [],\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"text\",\n \"required\": false,\n \"options\": [\n \"<string>\"\n ],\n \"extraction_hints\": \"<string>\",\n \"sort_order\": 123,\n \"metadata_key\": \"<string>\",\n \"intake_value_map\": {}\n }\n ],\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"master_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "existed"
}{
"success": true,
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"master_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "created",
"language": "<string>",
"timezone": "<string>",
"region_style": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}Create an Agent
This operation lets you create an agent for the authenticated Nexor account. This reference documents verified path, query, and top-level JSON body fields, observed response status codes, and top-level response fields. Provider-owned or deeply nested response shapes may remain open.
POST
/
workflows
Create an Agent
curl --request POST \
--url https://api.getnexor.ai/api/public/workflows \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"statuses": [
{
"key": "<string>",
"name": "<string>",
"label": "<string>",
"is_initial": false,
"is_terminal": false,
"sort_order": 123,
"entry_hint": "<string>",
"category": "<string>",
"color": "<string>",
"is_auto_contacted": false,
"is_auto_engaged": false,
"is_booking_target": false,
"is_qualified": false,
"requires_all_fields": false,
"pause_bot": false,
"required_field_keys": [
"<string>"
],
"transition_rules": {},
"timeout_config": {
"timeout": 1,
"target_status_key": "<string>"
},
"transfer_config": {
"target_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"assignment_config": {}
}
],
"master_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_name": "<string>",
"agent_role": "<string>",
"company_name": "<string>",
"begin_message": "<string>",
"timezone": "<string>",
"global_prompt": "<string>",
"channels": [],
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "text",
"required": false,
"options": [
"<string>"
],
"extraction_hints": "<string>",
"sort_order": 123,
"metadata_key": "<string>",
"intake_value_map": {}
}
],
"description": "<string>"
}
'import requests
url = "https://api.getnexor.ai/api/public/workflows"
payload = {
"name": "<string>",
"statuses": [
{
"key": "<string>",
"name": "<string>",
"label": "<string>",
"is_initial": False,
"is_terminal": False,
"sort_order": 123,
"entry_hint": "<string>",
"category": "<string>",
"color": "<string>",
"is_auto_contacted": False,
"is_auto_engaged": False,
"is_booking_target": False,
"is_qualified": False,
"requires_all_fields": False,
"pause_bot": False,
"required_field_keys": ["<string>"],
"transition_rules": {},
"timeout_config": {
"timeout": 1,
"target_status_key": "<string>"
},
"transfer_config": { "target_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a" },
"assignment_config": {}
}
],
"master_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agent_name": "<string>",
"agent_role": "<string>",
"company_name": "<string>",
"begin_message": "<string>",
"timezone": "<string>",
"global_prompt": "<string>",
"channels": [],
"fields": [
{
"key": "<string>",
"label": "<string>",
"type": "text",
"required": False,
"options": ["<string>"],
"extraction_hints": "<string>",
"sort_order": 123,
"metadata_key": "<string>",
"intake_value_map": {}
}
],
"description": "<string>"
}
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({
name: '<string>',
statuses: [
{
key: '<string>',
name: '<string>',
label: '<string>',
is_initial: false,
is_terminal: false,
sort_order: 123,
entry_hint: '<string>',
category: '<string>',
color: '<string>',
is_auto_contacted: false,
is_auto_engaged: false,
is_booking_target: false,
is_qualified: false,
requires_all_fields: false,
pause_bot: false,
required_field_keys: ['<string>'],
transition_rules: {},
timeout_config: {timeout: 1, target_status_key: '<string>'},
transfer_config: {target_workflow_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'},
assignment_config: {}
}
],
master_workflow_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
agent_name: '<string>',
agent_role: '<string>',
company_name: '<string>',
begin_message: '<string>',
timezone: '<string>',
global_prompt: '<string>',
channels: [],
fields: [
{
key: '<string>',
label: '<string>',
type: 'text',
required: false,
options: ['<string>'],
extraction_hints: '<string>',
sort_order: 123,
metadata_key: '<string>',
intake_value_map: {}
}
],
description: '<string>'
})
};
fetch('https://api.getnexor.ai/api/public/workflows', 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/workflows",
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([
'name' => '<string>',
'statuses' => [
[
'key' => '<string>',
'name' => '<string>',
'label' => '<string>',
'is_initial' => false,
'is_terminal' => false,
'sort_order' => 123,
'entry_hint' => '<string>',
'category' => '<string>',
'color' => '<string>',
'is_auto_contacted' => false,
'is_auto_engaged' => false,
'is_booking_target' => false,
'is_qualified' => false,
'requires_all_fields' => false,
'pause_bot' => false,
'required_field_keys' => [
'<string>'
],
'transition_rules' => [
],
'timeout_config' => [
'timeout' => 1,
'target_status_key' => '<string>'
],
'transfer_config' => [
'target_workflow_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'assignment_config' => [
]
]
],
'master_workflow_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'agent_name' => '<string>',
'agent_role' => '<string>',
'company_name' => '<string>',
'begin_message' => '<string>',
'timezone' => '<string>',
'global_prompt' => '<string>',
'channels' => [
],
'fields' => [
[
'key' => '<string>',
'label' => '<string>',
'type' => 'text',
'required' => false,
'options' => [
'<string>'
],
'extraction_hints' => '<string>',
'sort_order' => 123,
'metadata_key' => '<string>',
'intake_value_map' => [
]
]
],
'description' => '<string>'
]),
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/workflows"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"is_initial\": false,\n \"is_terminal\": false,\n \"sort_order\": 123,\n \"entry_hint\": \"<string>\",\n \"category\": \"<string>\",\n \"color\": \"<string>\",\n \"is_auto_contacted\": false,\n \"is_auto_engaged\": false,\n \"is_booking_target\": false,\n \"is_qualified\": false,\n \"requires_all_fields\": false,\n \"pause_bot\": false,\n \"required_field_keys\": [\n \"<string>\"\n ],\n \"transition_rules\": {},\n \"timeout_config\": {\n \"timeout\": 1,\n \"target_status_key\": \"<string>\"\n },\n \"transfer_config\": {\n \"target_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"assignment_config\": {}\n }\n ],\n \"master_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_name\": \"<string>\",\n \"agent_role\": \"<string>\",\n \"company_name\": \"<string>\",\n \"begin_message\": \"<string>\",\n \"timezone\": \"<string>\",\n \"global_prompt\": \"<string>\",\n \"channels\": [],\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"text\",\n \"required\": false,\n \"options\": [\n \"<string>\"\n ],\n \"extraction_hints\": \"<string>\",\n \"sort_order\": 123,\n \"metadata_key\": \"<string>\",\n \"intake_value_map\": {}\n }\n ],\n \"description\": \"<string>\"\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/workflows")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"is_initial\": false,\n \"is_terminal\": false,\n \"sort_order\": 123,\n \"entry_hint\": \"<string>\",\n \"category\": \"<string>\",\n \"color\": \"<string>\",\n \"is_auto_contacted\": false,\n \"is_auto_engaged\": false,\n \"is_booking_target\": false,\n \"is_qualified\": false,\n \"requires_all_fields\": false,\n \"pause_bot\": false,\n \"required_field_keys\": [\n \"<string>\"\n ],\n \"transition_rules\": {},\n \"timeout_config\": {\n \"timeout\": 1,\n \"target_status_key\": \"<string>\"\n },\n \"transfer_config\": {\n \"target_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"assignment_config\": {}\n }\n ],\n \"master_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_name\": \"<string>\",\n \"agent_role\": \"<string>\",\n \"company_name\": \"<string>\",\n \"begin_message\": \"<string>\",\n \"timezone\": \"<string>\",\n \"global_prompt\": \"<string>\",\n \"channels\": [],\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"text\",\n \"required\": false,\n \"options\": [\n \"<string>\"\n ],\n \"extraction_hints\": \"<string>\",\n \"sort_order\": 123,\n \"metadata_key\": \"<string>\",\n \"intake_value_map\": {}\n }\n ],\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getnexor.ai/api/public/workflows")
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 \"name\": \"<string>\",\n \"statuses\": [\n {\n \"key\": \"<string>\",\n \"name\": \"<string>\",\n \"label\": \"<string>\",\n \"is_initial\": false,\n \"is_terminal\": false,\n \"sort_order\": 123,\n \"entry_hint\": \"<string>\",\n \"category\": \"<string>\",\n \"color\": \"<string>\",\n \"is_auto_contacted\": false,\n \"is_auto_engaged\": false,\n \"is_booking_target\": false,\n \"is_qualified\": false,\n \"requires_all_fields\": false,\n \"pause_bot\": false,\n \"required_field_keys\": [\n \"<string>\"\n ],\n \"transition_rules\": {},\n \"timeout_config\": {\n \"timeout\": 1,\n \"target_status_key\": \"<string>\"\n },\n \"transfer_config\": {\n \"target_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"assignment_config\": {}\n }\n ],\n \"master_workflow_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"agent_name\": \"<string>\",\n \"agent_role\": \"<string>\",\n \"company_name\": \"<string>\",\n \"begin_message\": \"<string>\",\n \"timezone\": \"<string>\",\n \"global_prompt\": \"<string>\",\n \"channels\": [],\n \"fields\": [\n {\n \"key\": \"<string>\",\n \"label\": \"<string>\",\n \"type\": \"text\",\n \"required\": false,\n \"options\": [\n \"<string>\"\n ],\n \"extraction_hints\": \"<string>\",\n \"sort_order\": 123,\n \"metadata_key\": \"<string>\",\n \"intake_value_map\": {}\n }\n ],\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"master_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "existed"
}{
"success": true,
"workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"master_workflow_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "created",
"language": "<string>",
"timezone": "<string>",
"region_style": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>",
"code": "<string>"
}POST
The
Use
Other validation errors:
See Authentication.
/workflows
Create a new agent (funnel + statuses) from scratch — entirely via API. This is the first step in the API-first agent lifecycle:
- Create the agent (this endpoint). It’s born paused.
- Set its prompt — what it says and how it behaves.
- Optionally add custom statuses/fields or custom tools it can call.
- Activate it by setting
is_paused: false.
name already exists on your account, this returns the existing one (status: "existed") instead of creating a duplicate — safe to retry.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Agent name. Used for the idempotency check |
goal_type | string | Yes | One of the values in Available goals |
statuses | array | Yes | Non-empty array of funnel statuses (see below). If none is marked is_initial, the first one is used; if none is marked is_terminal, the last one is used |
description | string | No | Agent description |
global_prompt | string | No | Base prompt. You can also set this later via PATCH /workflows/:id/prompt |
language | string | No | Default es |
channels | array | No | Channels to enable, e.g. ["whatsapp", "email"]. Default ["whatsapp"] |
fields | array | No | Custom lead fields to collect (see Update Structure for the shape) |
Available goals
goal_type | Expected outcome | Notes |
|---|---|---|
appointment | Book a meeting | Enables calendar capabilities. |
payment_link | Send a payment link and complete payment | The integration that creates or supplies the link must be configured. |
qualification | Qualify the lead from collected data | Pair it with fields and stages that express the criteria. |
information | Answer questions | Usually depends on a knowledge base. |
support | Resolve or escalate support requests | Define explicit escalation rules. |
document_collection | Request and verify documents | The dashboard shows a Documents section for this goal. |
quote | Generate a quote from a catalog | Requires an assigned catalog. |
custom | Achieve an operator-written objective | Does not enable calendar tools. |
sale | Complete a sale | API-compatible value; it is not a preset in the current dashboard picker. |
Onboarding also offers Qualify, then book. That option is stored as
appointment with a qualification pipeline and rules; do not send qualify_then_book to this public endpoint.The custom goal
Use custom when the agent’s objective is not one of the preset goals — debt collection, client win-back, post-sale follow-up, or surveys. The agent pursues an objective written in the operator’s own words, configured in the Dashboard under Agent settings → Goal and stored as config.goal_statement. It accepts up to 600 characters and should describe the outcome, not the procedure. Two things to know:
- A
customagent does not schedule meetings — the calendar tools are not available to it. If the goal ends in a booked meeting, useappointment. - You must send
statusesas with every other goal. This endpoint does not infer the pipeline; a typical custom setup can usenew → contacted → engaged → converted → lostwith transition instructions adapted to the written outcome.
statuses[] shape
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Stable identifier for the status |
name | string | Yes | Display label (label also accepted) |
is_initial | boolean | No | Marks the funnel’s entry status |
is_terminal | boolean | No | Marks a funnel-ending status |
sort_order | integer | No | Defaults to array index |
Responses
201 — Agent created
{
"success": true,
"workflow_id": "123e4567-e89b-12d3-a456-426614174000",
"status": "created"
}
200 — Already existed (idempotent replay)
{
"success": true,
"workflow_id": "123e4567-e89b-12d3-a456-426614174000",
"status": "existed"
}
400 — Validation error
{
"error": "Invalid input",
"message": "name is required"
}
"goal_type must be one of: appointment, sale, qualification, information, payment_link, support, custom, quote, document_collection""statuses must be a non-empty array""each status needs a key and a name"
401 — Authentication error
See Authentication.
500 — Internal server error
Authorizations
API key for authentication. Keys are prefixed with nxr_live_.
Body
application/json
Minimum string length:
1Available options:
appointment, sale, qualification, information, payment_link, support, custom, quote, document_collection Minimum array length:
1- Option 1
- Option 2
Show child attributes
Show child attributes
Available options:
es-CL, es-MX, es-PE, es-CO, es-US, en-US, en-AU, ko-KR, pt-BR, fr-FR Maximum string length:
200Maximum string length:
200Maximum string length:
200Maximum string length:
1000Valid IANA time-zone name.
Available options:
cl, mx, pe, co, ar, es, latam, us, au, gb, in, nz, kr, br, pt Available options:
whatsapp, call, voice, retell, email, sms Show child attributes
Show child attributes
Last modified on September 25, 2026
⌘I